3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Box { public $value; } $box = new Box(); class Test { public function __construct() { global $box; var_dump($box->value = $this); } function __destruct() { global $box; unset($box->value); } } new Test(); new Test();
Output for 8.3.0 - 8.3.36, 8.4.1 - 8.4.27, 8.5.0 - 8.5.12
object(Test)#2 (0) { } object(Test)#3 (0) { }
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.34
object(Test)#2 (0) { } UNKNOWN:0

preferences:
19.99 ms | 1162 KiB | 6 Q