3v4l.org

run code in 300+ PHP versions simultaneously
<?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());
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.5.24 - 5.5.31, 5.6.8 - 5.6.17
Fatal error: Method Foo::__call() must take exactly 2 arguments in /in/EHUGZ on line 6
Process exited with code 255.

preferences:
168.98 ms | 1395 KiB | 28 Q