3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { function muta($bar) { $new = &$this; $new = $bar; } } $a = new foo; $a->muta(new stdClass); echo get_class($foo);
based on gtmAM
Output for 5.3.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: foo in /in/VPNWr on line 17 Warning: get_class() called without object from outside a class in /in/VPNWr on line 17
Output for 5.3.0
Notice: Undefined variable: foo in /in/VPNWr on line 17 Warning: get_class() expects parameter 1 to be object, null given in /in/VPNWr on line 17
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: foo in /in/VPNWr on line 17
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: foo in /in/VPNWr on line 17