Bug #74442 [NEW]: Opcached version produces a nested array

From: Date: Fri, 14 Apr 2017 16:24:22 +0000
Subject: Bug #74442 [NEW]: Opcached version produces a nested array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208555@lists.php.net to get a copy of this message
From: rasmus Operating system: Linux PHP version: 7.1.5RC1 Package: opcache Bug Type: Bug Bug description:Opcached version produces a nested array Description: ------------ Without opcache this script prints 4. With opcache, on the first request to this script you get 4 as well. On the 2nd request when you hit the opcached version you get a nested array. Reproducable from cli with: opcache.enable_cli=1 opcache.file_cache=/var/tmp opcache.file_cache_only=1 It is fine in 7.0, so it is something we broke in 7.1 Test script: --------------- <?php class Schema_Base { public function addField($typeclass, array $params = null) { $field = new $typeclass($params); return $field; } } class Field_Base { public function __construct(array $params = null) { if (! is_array($params)) { $params = (array) $params; } call_user_func_array(array($this, 'acceptParams'), $params); } } class Field_Integer extends Field_Base { protected function acceptParams($bytes = 4) { echo print_r($bytes, true); } } try { $schema = new Schema_Base; $schema->addField('Field_Integer'); } catch (Throwable $ex) { echo "CAUGHT EXCEPTION"; echo (string)$ex; } Expected result: ---------------- 4 Actual result: -------------- Array ( [0] => Array *RECURSION* ) -- Edit bug report at https://bugs.php.net/bug.php?id=74442&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74442&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74442&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74442&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74442&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74442&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74442&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74442&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74442&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74442&r=support Expected behavior: https://bugs.php.net/fix.php?id=74442&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74442&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74442&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74442&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74442&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74442&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74442&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74442&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74442&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74442&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74442&r=mysqlcfg

« previous php.bugs (#208555) next »