IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 5 LpH | Statistics
Login | Create New User

Welcome to IWETHEY!

New No function results either? You've gotta be kidding
empty() only works on variables.

What the fluck? You're kidding! It does not work on *function results* either.
\n<?php\n\n$x = empty(myFunc('foo'));\n\nfunction myFunc($a) {\nreturn($a . 'blah');\n}\n\n?>\n

What in Buddah's name were they thinking??? Substitability is a fundimental need of programming.

[empty()] they look like functions, but they aren't.

They are "fucktions"!

I noticed that the documentation at php.net has
changed for it. There used to be a bunch of
notes on it and how it differed from isset().
That is all gone now it seems. Note that it
says that isset() is also a "language construct".

Thanks for enlightening me.
Expand Edited by tablizer Nov. 12, 2002, 02:04:52 PM EST
New What are you actually trying to check for?
I very rarely use empty() but I use is_null() a bit and isset() a lot. IMO, empty() is vestigial. PHP doesn't actually have a concept of "empty".

I much prefer Icon's approach: not-set variables are semantically identical to those containing &null which can be passed like any other value. Icon also has prefix operators / and \\ which mean check for null and check for not-null. Much cleaner than PHP's isset().


"Ah. One of the difficult questions."

New type agnostic
"Empty" is a lot like XBase's "empty" :-) You don't have to worry about whether it is a string or number. You can later change the "type" for example, and not worry about code not working. Also, some databases don't have null number defaults (by vendor or DBA decision), but initialize to zero. Thus, it also makes it more DB vendor agnostic. IOW, "maintenance friendly". I like it.

Regardless, I think accepting only variables and NOT functions nor constants is just plain dumb! (for all the "language constructs", not just "empty".)
     PHP 'empty' Oddity - (tablizer) - (4)
         That construct isn't supposed to work. - (static) - (3)
             No function results either? You've gotta be kidding - (tablizer) - (2)
                 What are you actually trying to check for? - (static) - (1)
                     type agnostic - (tablizer)

Laugh self to death.
66 ms