3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public $x; public function foo() { $this->x(42); } } $a = new A; $a->x = function($v) {var_dump($v);}; ($a->x)();
based on R1CE0
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 0 passed in /in/qO1WR on line 11 and exactly 1 expected in /in/qO1WR:10 Stack trace: #0 /in/qO1WR(11): {closure}() #1 {main} thrown in /in/qO1WR on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for {closure}(), called in /in/qO1WR on line 11 and defined in /in/qO1WR on line 10 Notice: Undefined variable: v in /in/qO1WR on line 10 NULL
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected '(' in /in/qO1WR on line 11
Process exited with code 255.