|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-04-14 16:59 UTC] rasmus@php.net
[2017-04-14 20:21 UTC] nikic@php.net
[2017-04-14 20:21 UTC] nikic@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
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* )