3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Foo { public $hidden function hide() { $hidden = $this; unset($this); } function hello() { echo 'world'; } } class Bar { use Foo; } $foo = new Bar(); $foo->destroy(); echo $foo->bar; $foo->hello();
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting ',' or ';' in /in/tg3ss on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/tg3ss on line 3
Process exited with code 255.

preferences:
174.96 ms | 1386 KiB | 63 Q