bug #15386 [php7] Fix for substr() always returning a string (nicolas-grekas)
This PR was merged into the 2.3 branch.
Discussion
----------
[php7] Fix for substr() always returning a string
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #14086
| License | MIT
| Doc PR | -
This should be the last required fix for PHP7 support.
The patch in the debug component is a workaround for a bug in PHP7 (http://3v4l.org/8rm9B) that is going to be fixed soon (@jpauli power).
Commits
-------
77ee866
[php7] Fix for substr() always returning a string
This commit is contained in:
commit
ccf52ecd6e
@ -215,8 +215,8 @@ class ArgvInput extends Input
|
|||||||
|
|
||||||
$option = $this->definition->getOption($name);
|
$option = $this->definition->getOption($name);
|
||||||
|
|
||||||
// Convert false values (from a previous call to substr()) to null
|
// Convert empty values to null
|
||||||
if (false === $value) {
|
if (!isset($value[0])) {
|
||||||
$value = null;
|
$value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,11 +121,11 @@ PHP
|
|||||||
$that->assertEquals('->', $trace[0]['type']);
|
$that->assertEquals('->', $trace[0]['type']);
|
||||||
|
|
||||||
$that->assertEquals(__FILE__, $trace[1]['file']);
|
$that->assertEquals(__FILE__, $trace[1]['file']);
|
||||||
$that->assertEquals(__CLASS__, $trace[1]['class']);
|
$that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[1]['class']);
|
||||||
$that->assertEquals('triggerNotice', $trace[1]['function']);
|
$that->assertEquals('triggerNotice', $trace[1]['function']);
|
||||||
$that->assertEquals('::', $trace[1]['type']);
|
$that->assertEquals('::', $trace[1]['type']);
|
||||||
|
|
||||||
$that->assertEquals(__CLASS__, $trace[2]['class']);
|
$that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[2]['class']);
|
||||||
$that->assertEquals('testNotice', $trace[2]['function']);
|
$that->assertEquals('testNotice', $trace[2]['function']);
|
||||||
$that->assertEquals('->', $trace[2]['type']);
|
$that->assertEquals('->', $trace[2]['type']);
|
||||||
};
|
};
|
||||||
|
@ -320,7 +320,7 @@ class Parser
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) {
|
if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) {
|
||||||
// the previous line contained a dash but no item content, this line is a sequence item with the same indentation
|
// the previous line contained a dash but no item content, this line is a sequence item with the same indentation
|
||||||
// and therefore no nested list or mapping
|
// and therefore no nested list or mapping
|
||||||
$this->moveToPreviousLine();
|
$this->moveToPreviousLine();
|
||||||
|
Reference in New Issue
Block a user