Bug #77492 [NEW]: function return empty
| From: | poiuty at lepus dot su | Date: | Sun, 20 Jan 2019 16:41:48 +0000 |
| Subject: | Bug #77492 [NEW]: function return empty | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-219096@lists.php.net to get a copy of this message | ||
From: poiuty at lepus dot su
Operating system: debian 9
PHP version: 7.3.1
Package: opcache
Bug Type: Bug
Bug description:function return empty
Description:
------------
[opcache]
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
# php -v
PHP 7.3.1-1+0~20190113101756.25+stretch~1.gbp15aaa9 (cli) (built: Jan 13
2019 10:17:57) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.1-1+0~20190113101756.25+stretch~1.gbp15aaa9,
Copyright (c) 1999-2018, by Zend Technologies
Test script:
---------------
function testB(){
$x = ['a' => '', 'b' => ''];
$num = range(0, 9);
foreach($num as $k){
$x['a'] .= $k;
}
return $x;
}
function testA(){
$x = ['a' => '', 'b' => ''];
$num = range(0, 9);
foreach($num as $k){
$x['a'] .= $k;
}
return $x['a'];
}
// if opcache.enable=1 => string(0) ""
// if opcache.enable=0 => string(10) "0123456789"
// if call first testB() => string(10) "0123456789"
//var_dump(testB());
var_dump(testA());
full script:
https://gist.github.com/poiuty/9759972fcc6bee42bbb250c03ef43e77
--
Edit bug report at https://bugs.php.net/bug.php?id=77492&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77492&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77492&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77492&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77492&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77492&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77492&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77492&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77492&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77492&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77492&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77492&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77492&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77492&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77492&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77492&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77492&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77492&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77492&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77492&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77492&r=mysqlcfg