id = $id; $this->name = $name; } } $user = new User(10, []); // This Will throw a Fatal error. # Typed Properties with PHP 7.4 All types are supported, with the exception of void and callable. class NewUser { public int $id; public string $name; } $newUser = new NewUser; $newUser->id = 10; $newUser->name = []; // This Will throw a Fatal error too !!