<?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"));
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.
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