10000 bug #15386 [php7] Fix for substr() always returning a string (nicolas… · symfony/symfony@ccf52ec · GitHub
[go: up one dir, main page]

Skip to content

Commit ccf52ec

Browse files
committed
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
2 parents 633d0d8 + 77ee866 commit ccf52ec

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Symfony/Component/Console/Input/ArgvInput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ private function addLongOption($name, $value)
215215

216216
$option = $this->definition->getOption($name);
217217

218-
// Convert false values (from a previous call to substr()) to null
219-
if (false === $value) {
218+
// Convert empty values to null
219+
if (!isset($value[0])) {
220220
$value = null;
221221
}
222222

src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ public function testNotice()
121121
$that->assertEquals('->', $trace[0]['type']);
122122

123123
$that->assertEquals(__FILE__, $trace[1]['file']);
124-
$that->assertEquals(__CLASS__, $trace[1]['class']);
124+
$that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[1]['class']);
125125
$that->assertEquals('triggerNotice', $trace[1]['function']);
126126
$that->assertEquals('::', $trace[1]['type']);
127127

128-
$that->assertEquals(__CLASS__, $trace[2]['class']);
128+
$that->assertEquals('Symfony\Component\Debug\Tests\ErrorHandlerTest', $trace[2]['class']);
129129
$that->assertEquals('testNotice', $trace[2]['function']);
130130
$that->assertEquals('->', $trace[2]['type']);
131131
};

src/Symfony/Component/Yaml/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
320320
return;
321321
}
322322

323-
if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) {
323+
if ($inSequence && $oldLineIndentation === $newIndent && isset($data[0][0]) && '-' === $data[0][0]) {
324324
// the previous line contained a dash but no item content, this line is a sequence item with the same indentation
325325
// and therefore no nested list or mapping
326326
$this->moveToPreviousLine();

0 commit comments

Comments
 (0)
0