Closed BitOne closed 6 years ago
With the following code:
<?php unset($_GET); unset($_FILES); unset($_POST); unset($_SERVER); unset($_COOKIE); unset($argv); unset($argc); $a = "test"; $b =& $a; $c = strlen($b); meminfo_dump(fopen('php://stdout', 'w'));
With PHP7, wrong output: b shouldn't be there, as it's a reference to a. And a has type unknown.
b
a
unknown
"items": { "0x7fb93bc571e0" : { "type" : "unknown", "size" : "16", "symbol_name" : "a", "is_root" : true, "frame" : "<GLOBAL>" }, "0x7fb93bc57200" : { "type" : "unknown", "size" : "16", "symbol_name" : "b", "is_root" : true, "frame" : "<GLOBAL>" }, "0x7fb93bc57220" : { "type" : "integer", "size" : "16", "symbol_name" : "c", "is_root" : true, "frame" : "<GLOBAL>" } }
With PHP5, the output is correct:
{ "items": { "0x7f96977ad158" : { "type" : "string", "size" : "28", "symbol_name" : "a", "is_root" : true, "frame" : "<GLOBAL>" }, "0x7f96977ad0f8" : { "type" : "integer", "size" : "24", "symbol_name" : "c", "is_root" : true, "frame" : "<GLOBAL>" } }
With the following code:
With PHP7, wrong output:
b
shouldn't be there, as it's a reference toa
. Anda
has typeunknown
.With PHP5, the output is correct: