3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { function __destruct() { echo "beep\n"; } } function alpha($foo) { echo "before\n"; $foo = "eat shit\n"; echo "after\n"; var_dump($foo); var_dump(func_get_args()); } alpha(new Foo);
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
before beep after string(9) "eat shit " array(1) { [0]=> string(9) "eat shit " }
Output for 5.0.0 - 5.6.28
before after string(9) "eat shit " array(1) { [0]=> object(Foo)#1 (0) { } } beep
Output for 4.3.0 - 4.4.9
before after string(9) "eat shit " array(1) { [0]=> object(foo)(0) { } }