3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test($var) { echo "Testing: $var\n"; } class foo { var $baz = "test"; function bar( $str ) { if( is_callable( $this->baz )) { $this->baz( $str ); } } } $foo = new foo; try { $foo->bar("bla"); // fatal error } catch (Error $e){ echo "Whoops -- ", $e->getMessage(); echo "\nEnd of Script :)"; }
based on 6bIVj
Output for 7.0.0 - 7.2.0
Whoops -- Call to undefined method foo::baz() End of Script :)
Output for 5.3.22 - 5.6.28
Fatal error: Call to undefined method foo::baz() in /in/u9FOV on line 13
Process exited with code 255.