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) { echo 'working'; } } (new B)->work(); (new A)->work(); (new A)->not();
based on PmI25
Output for 7.1.0 - 7.3.0rc3
Fatal error: Uncaught ArgumentCountError: Too few arguments to function B::work(), 0 passed in /in/SGjGg on line 14 and exactly 3 expected in /in/SGjGg:11 Stack trace: #0 /in/SGjGg(14): B->work() #1 {main} thrown in /in/SGjGg on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for B::work(), called in /in/SGjGg on line 14 and defined in /in/SGjGg on line 11 Warning: Missing argument 2 for B::work(), called in /in/SGjGg on line 14 and defined in /in/SGjGg on line 11 Warning: Missing argument 3 for B::work(), called in /in/SGjGg on line 14 and defined in /in/SGjGg on line 11 working Warning: Missing argument 1 for B::work(), called in /in/SGjGg on line 6 and defined in /in/SGjGg on line 11 Warning: Missing argument 2 for B::work(), called in /in/SGjGg on line 6 and defined in /in/SGjGg on line 11 Warning: Missing argument 3 for B::work(), called in /in/SGjGg on line 6 and defined in /in/SGjGg on line 11 working Fatal error: Uncaught Error: Call to undefined method B::not() in /in/SGjGg:6 Stack trace: #0 /in/SGjGg(16): A->__call('not', Array) #1 {main} thrown in /in/SGjGg on line 6
Process exited with code 255.
Output for hhvm-3.15.4
Warning: work() expects exactly 3 parameters, 0 given in /in/SGjGg on line 11 working Warning: work() expects exactly 3 parameters, 0 given in /in/SGjGg on line 11 working Fatal error: Uncaught Error: Call to undefined method B::not() in /in/SGjGg:6 Stack trace: #0 /in/SGjGg(16): A->__call() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Missing argument 1 for B::work(), called in /in/SGjGg on line 14 and defined in /in/SGjGg on line 11 Warning: Missing argument 2 for B::work(), called in /in/SGjGg on line 14 and defined in /in/SGjGg on line 11 Warning: Missing argument 3 for B::work(), called in /in/SGjGg on line 14 and defined in /in/SGjGg on line 11 working Warning: Missing argument 1 for B::work(), called in /in/SGjGg on line 6 and defined in /in/SGjGg on line 11 Warning: Missing argument 2 for B::work(), called in /in/SGjGg on line 6 and defined in /in/SGjGg on line 11 Warning: Missing argument 3 for B::work(), called in /in/SGjGg on line 6 and defined in /in/SGjGg on line 11 working Fatal error: Call to undefined method B::not() in /in/SGjGg on line 6
Process exited with code 255.