|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-08-06 14:08 UTC] nicolas dot grekas+php at gmail dot com
Description: ------------ when running the Symfony test suite on PHP 7.3 with opcache.enable_cli=1, some tests fail with "Illegal string offset '...'" errors, which make no sense: Example build is: https://travis-ci.org/nicolas-grekas/symfony/builds/411802579#L2508 The reported line reads as such: > if (!$uri || '#' == $uri[0] || '?' == $uri[0]) { See https://github.com/symfony/symfony/blob/master/src/Symfony/Component/BrowserKit/Client.php#L668 It looks like there is a leak from L649 to L668: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/BrowserKit/Client.php#L649 Test script: --------------- No better reproducer sorry: git clone https://github.com/symfony/symfony cd symfony composer install ./phpunit install php -dopcache.enable_cli=1 ./phpunit src/Symfony/Component/BrowserKit PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
I can not reproduce this, what I got is: $ /home/huixinchen/local/php73/bin/php -d opcache.enable_cli=1 -d error_reporting=-1 -d display_errors=1 ./phpunit src/Symfony/Component/BrowserKit #!/usr/bin/env php PHPUnit 6.5.10 by Sebastian Bergmann and contributors. Testing src/Symfony/Component/BrowserKit .............................................F................. 63 / 136 ( 46%) ............................................................... 126 / 136 ( 92%) .......... 136 / 136 (100%) Time: 691 ms, Memory: 4.00MB There was 1 failure: 1) Symfony\Component\BrowserKit\Tests\ClientTest::testFollowMetaRefresh with data set #7 ('<html><head><noscript><meta h.../html>', 'http://www.example.com/redirected') Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'http://www.example.com/redirected' +'http://www.example.com/foo/foobar' /home/huixinchen/opensource/github/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php:669 /home/huixinchen/opensource/github/symfony/.phpunit/phpunit-6.5/phpunit:5 FAILURES! Tests: 136, Assertions: 312, Failures: 1.Here is a simple reproduce (under valgrind): <?php function test($foo) { var_dump(0); var_dump($foo[0]); } test("str");