3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo{ public function __call($n,$a){ return $this->$a->call($this,$a); } } $f=new Foo(); $f->b=function($n){echo$n;}; var_dump($f->b(7));
based on N5hXC
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/aqq23 on line 5 Notice: Undefined property: Foo::$Array in /in/aqq23 on line 5 Fatal error: Uncaught Error: Call to a member function call() on null in /in/aqq23:5 Stack trace: #0 /in/aqq23(11): Foo->__call('b', Array) #1 {main} thrown in /in/aqq23 on line 5
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Notice: Array to string conversion in /in/aqq23 on line 5 Notice: Undefined property: Foo::$Array in /in/aqq23 on line 5 Fatal error: Call to a member function call() on null in /in/aqq23 on line 5
Process exited with code 255.
Output for 5.3.22 - 5.5.35
Notice: Array to string conversion in /in/aqq23 on line 5 Notice: Undefined property: Foo::$Array in /in/aqq23 on line 5 Fatal error: Call to a member function call() on a non-object in /in/aqq23 on line 5
Process exited with code 255.