Bug #76477 [NEW]: Opcache causes empty return value
| From: | mark2011 at mayberg dot se | Date: | Thu, 14 Jun 2018 13:16:53 +0000 |
| Subject: | Bug #76477 [NEW]: Opcache causes empty return value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-215721@lists.php.net to get a copy of this message | ||
From: mark2011 at mayberg dot se
Operating system: Linux
PHP version: 7.2.6
Package: opcache
Bug Type: Bug
Bug description:Opcache causes empty return value
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 bug report at https://bugs.php.net/bug.php?id=76477&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76477&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76477&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76477&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76477&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76477&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76477&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76477&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76477&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76477&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76477&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76477&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76477&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76477&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76477&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76477&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76477&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76477&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76477&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76477&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76477&r=mysqlcfg