3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $b; function __construct() { $this->b = new B; } function __call($method, $args) { $this->b->$method(...$args); } } class B { function work($p1, $p2, $p3) { var_dump($p1, $p2, $p3); } } (new B)->work(1, 2, 3); (new A)->work(4, 5, 6); (new A)->not();
based on SGjGg
Output for 7.0.0 - 7.2.6
int(1) int(2) int(3) int(4) int(5) int(6) Fatal error: Uncaught Error: Call to undefined method B::not() in /in/eoXCP:6 Stack trace: #0 /in/eoXCP(16): A->__call('not', Array) #1 {main} thrown in /in/eoXCP on line 6
Process exited with code 255.
Output for hhvm-3.15.4
int(1) int(2) int(3) int(4) int(5) int(6) Fatal error: Uncaught Error: Call to undefined method B::not() in /in/eoXCP:6 Stack trace: #0 /in/eoXCP(16): A->__call() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
int(1) int(2) int(3) int(4) int(5) int(6) Fatal error: Call to undefined method B::not() in /in/eoXCP on line 6
Process exited with code 255.