Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 342c4b5

Browse files
committed
bug #15390 [php7] Fix for substr() always returning a string (nicolas-grekas)
This PR was merged into the 2.7 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 | - The remaining failures will stop once https://bugs.php.net/bug.php?id=70159 is fixed ([patch pending](php/php-src@a28115c)). Commits ------- d6dfe98 [php7] Fix for substr() always returning a string
2 parents c37387d + d6dfe98 commit 342c4b5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ private function autoPrependBlock()
379379
{
380380
$chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
381381

382-
if (false === $chars) {
382+
if (!isset($chars[0])) {
383383
return $this->newLine(); //empty history, so we should start with a new line.
384384
}
385385
//Prepend new line for each non LF chars (This means no blank line was output before)

src/Symfony/Component/VarDumper/Tests/Caster/ReflectionCasterTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Component\VarDumper\Tests\Caster;
1313

14-
use Symfony\Component\VarDumper\Cloner\VarCloner;
15-
use Symfony\Component\VarDumper\Dumper\CliDumper;
1614
use Symfony\Component\VarDumper\Test\VarDumperTestCase;
1715

1816
/**
@@ -34,7 +32,7 @@ public function testReflectionCaster()
3432
constants: array:3 [
3533
"IS_IMPLICIT_ABSTRACT" => 16
3634
"IS_EXPLICIT_ABSTRACT" => 32
37-
"IS_FINAL" => 64
35+
"IS_FINAL" => %d
3836
]
3937
properties: array:%d [
4038
"name" => ReflectionProperty {

0 commit comments

Comments
 (0)