<?php
unset($_GET);
unset($_FILES);
unset($_POST);
unset($_SERVER);
unset($_COOKIE);
unset($argv);
unset($argc);
class MyClass {
public $myDeclaredVar;
}
$myObject = new MyClass();
$myObject->myDeclaredVar = "My declared var content";
$myObject->myUndeclaredVar = "My undeclared content";
$myObject->chilObject = new StdClass()
meminfo_dump(fopen('php://stdout', 'w'));
From this code:
The output from the PHP 7 extension shows:
The 3 children strings are properly accounted for, but the declared string got the wrong item identifier, as well as the object.
Same PHP file executed with the PHP5 extension shows proper behavior: