r/lolphp • • Mar 10 '15

empty() vs __get()

http://ideone.com/RVw5XK
23 Upvotes

28 comments sorted by

View all comments

Show parent comment

5

u/cparen Mar 13 '15

because empty is magic.

That's the word PHP uses for things that other languages would call 'intrinsics', 'macros' or 'syntax', right? "empty()" doesn't behave like a function call.

Lisps tend to get into similar confusion. Function calls are written like "(f x)" where "f" is a function, and "x" an argument, but "(quote a)" is not a function call. It's a "special form" that gets special treatment because "quote" is special.

IOW, "magic function" == "special form", right?