Is a property default value of null the same as no default value?
问题 And can I therefore safely refactor all instances of class Blah { // ... private $foo = null; // ... } to class Blah { // ... private $foo; // ... } ? 回答1: Simple answer, yes. See http://php.net/manual/en/language.types.null.php The special NULL value represents a variable with no value. NULL is the only possible value of type null. You can easily test by performing a var_dump() on the property and you will see both instances it will be NULL class Blah1 { private $foo; function test() { var