Bug #76477 [Com]: Opcache causes empty return value

From: Date: Thu, 14 Jun 2018 14:21:16 +0000
Subject: Bug #76477 [Com]: Opcache causes empty return value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215723@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76477&edit=1 ID: 76477 Comment by: sjon at hortensius dot net Reported by: mark2011 at mayberg dot se Summary: Opcache causes empty return value Status: Open Type: Bug Package: opcache Operating System: Linux PHP Version: 7.2.6 Block user comment: N Private report: N New Comment: I can reproduce this with a pretty vanilla 7.2.6 under Archlinux. It can be simplified somewhat; this is also unstable (sometimes it returns 3, sometimes NULL): <?php t(); function t() { $l = strlenb("ABC"); var_dump($l); } function strlenb() { return call_user_func_array("strlen", func_get_args()); } Previous Comments: ------------------------------------------------------------------------ [2018-06-14 13:16:51] mark2011 at mayberg dot se Description: ------------ Running the test script without opcache works fine. But with opcache enabled it results in an unexpected behaviour (after second execution). The test script below is extracted from a bigger library, I isolated a small test case. PHP 7.2.6 is not yet available for my distro. PHP 7.0, 7.1 does not show this error. Test script: --------------- <?php echo "PHP ".PHP_VERSION." ".PHP_SAPI."<br>\n"; $token = "ABC"; $lengthBytes = strlenb($token); echo "$token $lengthBytes ".($lengthBytes!=0 ? "ok" : "error")."<br>\n"; testString(); function testString() { $token = "ABC"; $lengthBytes = strlenb($token); echo "$token $lengthBytes ".($lengthBytes!=0 ? "ok" : "error")."<br>\n"; } function strlenb() { return call_user_func_array("strlen", func_get_args()); } ?> Expected result: ---------------- PHP 7.2.5-0ubuntu0.18.04.1 apache2handler ABC 3 ok ABC 3 ok Actual result: -------------- PHP 7.2.5-0ubuntu0.18.04.1 apache2handler ABC 3 ok ABC error ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76477&edit=1

« previous php.bugs (#215723) next »