Skip to content

Instantly share code, notes, and snippets.

Created August 17, 2015 23:49
What would you like to do?
$ hh_single_type_check test.php
File "test.php", line 7, characters 7-7:
Class B does not initialize all of its members; name is not always initialized.
Make sure you systematically set $this->name when the method __construct is called.
Alternatively, you can define the member as optional (?...)
abstract class A {
protected string $name;
class B extends A {
protected string $name = 'Hello';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment