3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); class Test { private $data; public function __construct($d){ $this->data = $d; } public function listy(){ list($a,$b,$c) = $this->data; echo $a,"\n"; echo $b,"\n"; echo $c,"\n"; } } (new Test)->listy(array("a","b","c"));
based on 0YpVZ
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Test::__construct(), 0 passed in /in/DhXJU on line 18 and exactly 1 expected in /in/DhXJU:6 Stack trace: #0 /in/DhXJU(18): Test->__construct() #1 {main} thrown in /in/DhXJU on line 6
Process exited with code 255.
Output for 5.4.0 - 7.0.20
Warning: Missing argument 1 for Test::__construct(), called in /in/DhXJU on line 18 and defined in /in/DhXJU on line 6 Notice: Undefined variable: d in /in/DhXJU on line 7
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/DhXJU on line 18
Process exited with code 255.