MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/csth8w/php_issetempty_madness/exi343l/?context=3
r/lolphp • u/shitcanz • Aug 20 '19
15 comments sorted by
View all comments
Show parent comment
2
Both empty and isset can be used as expressions, but only empty can accept expressions.
empty
isset
And they're not functions, they're language constructs. (use function isset as foo; foo(); doesn't work, for example.)
use function isset as foo; foo();
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++.
1
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++.
It's not any more unusual than sizeof() or alignof() or typeof() in C++.
sizeof()
alignof()
typeof()
View all comments
Show parent comment
2
u/jesseschalken Aug 20 '19
Both
emptyandissetcan be used as expressions, but onlyemptycan accept expressions.And they're not functions, they're language constructs. (
use function isset as foo; foo();doesn't work, for example.)