|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-06-13 13:17 UTC] cmb@php.net
-PHP Version: master-Git-2018-06-13 (Git)
+PHP Version: 7.3.0alpha1
[2018-06-13 13:17 UTC] cmb@php.net
[2018-06-14 09:26 UTC] laruence@php.net
-Status: Open
+Status: Analyzed
-Assigned To:
+Assigned To: laruence
[2018-06-14 09:26 UTC] laruence@php.net
[2018-06-14 09:46 UTC] nikic@php.net
[2018-06-14 14:47 UTC] laruence@php.net
[2018-06-15 09:59 UTC] dmitry@php.net
[2018-06-15 16:53 UTC] nikic@php.net
[2018-06-18 08:21 UTC] dmitry@php.net
[2018-06-18 08:21 UTC] dmitry@php.net
-Status: Analyzed
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ Running the test script without Opcache works fine, but with Opcache enabled it results in erroneous behavior (at least after a few tries). PHP-7.2 does not exhibit this bug. Test script: --------------- <?php function foo() { for ($i = 1; $i <= 2; $i++) { if ($i == 2) { $type = 'text'; } else { $type = 'varchar'; } $field_array[] = ['name' => "pal_field{$i}", 'type' => $type, 'length' => 255, 'unsigned' => 1]; } var_dump($field_array); } foo(); Expected result: ---------------- array(2) { [0]=> array(4) { ["name"]=> string(10) "pal_field1" ["type"]=> string(7) "varchar" ["length"]=> int(255) ["unsigned"]=> int(1) } [1]=> array(4) { ["name"]=> string(10) "pal_field2" ["type"]=> string(4) "text" ["length"]=> int(255) ["unsigned"]=> int(1) } } Actual result: -------------- array(2) { [0]=> array(4) { ["name"]=> string(10) "pal_field1" ["type"]=> string(7) "varchar" ["length"]=> int(255) ["unsigned"]=> int(1) } [1]=> array(4) { ["name"]=> string(10) "pal_field1" ["type"]=> string(7) "varchar" ["length"]=> int(255) ["unsigned"]=> int(1) } }