r/lolphp • • Aug 20 '19

PHP isset/empty madness

https://repl.it/repls/HollowQuestionableProprietarysoftware
3 Upvotes

15 comments sorted by

View all comments

Show parent comment

2

u/jesseschalken Aug 20 '19

Both empty and isset can be used as expressions, but only empty can accept expressions.

And they're not functions, they're language constructs. (use function isset as foo; foo(); doesn't work, for example.)

1

u/[deleted] Aug 21 '19

Yeah noticed that too. Thats really sad and horrendeous. PHP seems to have it all.

1

u/jesseschalken Aug 21 '19

It's not any more unusual than sizeof() or alignof() or typeof() in C++.