3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { } $a1 = new A(); $a2 = $a1; print_r($a1); print_r($a2); unset($a1); print_r($a1); print_r($a2);
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
A Object ( ) A Object ( ) Notice: Undefined variable: a1 in /in/v168L on line 17 A Object ( )
Output for 5.0.0 - 5.0.3
A Object ( ) A Object ( ) Notice: Undefined variable: a1 in /in/v168L on line 17 A Object ( )
Output for 4.3.0 - 4.4.9
a Object ( ) a Object ( ) Notice: Undefined variable: a1 in /in/v168L on line 17 a Object ( )