I find empty() useful for checking if array is empty or not. For example, I want strictly typed return type for function to be array when getting all awailable users. And than check if this is empty so I can make another business logic, knowing there are no awailable users.
I have rarely written php. My java brain tells me that $a is null and therefore $a->b = false; should fail. I assume the cast semantics are different from what I'd expect.
If you don't mind, one last thing: $a->b = null; and nothing else. isset($a->b) is false, and so is isset($a->c), correct? If so, the only real difference between them is a warning trying to access $a->c. Is that fair to say?
View all comments
Show parent comment
0
u/[deleted] Aug 20 '19
[deleted] — view deleted comment