|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-04-03 02:39 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
[2015-04-03 02:39 UTC] laruence@php.net
[2015-04-03 03:32 UTC] for-bugs at hnw dot jp
-Summary: eval()ed string literal is not intened on
PHP7+OPcache
+Summary: eval()ed string literal is not interned on
PHP7+OPcache
[2015-04-03 03:32 UTC] for-bugs at hnw dot jp
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 04:00:01 2025 UTC |
Description: ------------ On PHP7 without OPcache, eval('$bar="baz"') makes interned string. However, eval()ed string literal is dynamically allocated with OPcache enabled. The interned string on PHP7 is not refcounted. So, string refcount(2) means non-interned. Test script: --------------- <?php $foo="baz"; $eval_str='$bar="baz";'; eval($eval_str); debug_zval_dump($foo); debug_zval_dump($bar); Expected result: ---------------- string(3) "baz" refcount(1) string(3) "baz" refcount(1) Actual result: -------------- string(3) "baz" refcount(1) string(3) "baz" refcount(2)