3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class B{ static $bobo; } class A{ function __destruct(){ debug_zval_dump($this); B::$bobo = $this; debug_zval_dump($this); } } $x = new A; debug_zval_dump($x); unset($x);
based on A1gkQ
Output for 7.1.0 - 7.2.0
object(A)#1 (0) refcount(2){ } object(A)#1 (0) refcount(3){ } object(A)#1 (0) refcount(4){ }
Output for 5.3.20 - 7.0.20
object(A)#1 (0) refcount(2){ } object(A)#1 (0) refcount(4){ } object(A)#1 (0) refcount(5){ }