This question already has an answer here:
Example A:
class F {
private $f = null;
}
Example B:
class F {
private $f;
}
Any different between those two classes?
</div>
There is no difference between these two variable both of consider as null
-------------------------------------------------------------------------------
| Expression | gettype() | empty() | is_null() | isset() | boolean |
-------------------------------------------------------------------------------
| $f = null; | NULL | TRUE | TRUE | FALSE | FALSE |
| $f; | NULL | TRUE | TRUE | FALSE | FALSE |
-------------------------------------------------------------------------------
This is from @RexM answers
null is a special placeholder value in the programming language that literally means "nothing". It's not 0, it's not an empty string, it's nothing. There is no value in memory being pointed to. An empty string, on the other hand, is still a string object, just a very short one :)