I just got this fatal error
Acceptable fatal error: argument 1 passed to :: __ construct () must be an integer instance called in / home / radu / php _projects / audio_player / index.php on line 9 and defined in / home / radu / php _projects / audio_player / php / File.php on line 7
So there is a class
class File{
public $id;
public $name;
public $file_paths;
public function __construct(integer $id=null, string $name=null, array $file_paths=null)
{
foreach(func_get_args() as $name => $val)
{
$this->$name = $val;
}
}
}
And here is the code that causes the error
$file = new File(1, "sound", array());
Am I missing something or is something bad with this hint of a PHP type?
source
share