3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MyTrait { public function __get() { echo get_class($this); } } class Foo { use MyTrait; } $foo = new Foo(); echo $foo->unknown;
Output for 5.4.0 - 5.4.25
Fatal error: Method MyTrait::__get() must take exactly 1 argument in /in/eshhM on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/eshhM on line 3
Process exited with code 255.

preferences:
172.65 ms | 1395 KiB | 62 Q