1.2K reads
3 comments
·Apr 9, 2023
Apr 9, 2023
count($a) === 0
is even more readable, or? 🤔
1
·
·1 reply
Author
·Apr 9, 2023
I think yes, it's at the same level as empty($a), but the point is we're letting go of a tiny bit of readability in exchange for a more trusted/clear code. When we do $a === [] we know for sure that it's a plain array and not an Arrayable object or similar. It's down to personal preference anyway.
1
·
·Apr 11, 2023
Apr 11, 2023
1
·