I just got this Fatal Error
Catchable fatal error: Argument 1 passed to File::__construct() must be an instance of integer, integer given, 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 the 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 triggers the error
$file = new File(1, "sound", array());
Am I missing something or there is something bad with this PHP type hinting?