3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait Foo { public function __call(){ echo "foo call"; } } class Baz { protected $foo; protected $bar = null; use Foo; public function test(){ var_dump(isset($this->foo)); var_dump(isset($this->bar)); return get_object_vars($this); } } var_dump((new Baz)->test());
based on ica3S
Output for 7.0.0 - 7.0.2
Fatal error: Method Foo::__call() must take exactly 2 arguments in /in/EHUGZ on line 5
Process exited with code 255.
Output for 5.4.12 - 5.6.17
Fatal error: Method Foo::__call() must take exactly 2 arguments in /in/EHUGZ on line 6
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/EHUGZ on line 3
Process exited with code 255.