3v4l.org

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