Date: 05/30/98
- Next message: rasmus: "[PHP-DEV] CVS update: php3/functions"
- Previous message: Rasmus Lerdorf: "Re: [PHP-DEV] Bug #417: silent (?) change in variable's value behaviour"
- In reply to: Zeev Suraski: "Re: [PHP-DEV] Bug #417: silent (?) change in variable's value behaviour"
- Next in thread: Zeev Suraski: "[PHP-DEV] Re: empty() II"
- Reply: Zeev Suraski: "[PHP-DEV] Re: empty() II"
- Reply: Rasmus Lerdorf: "Re: [PHP-DEV] empty() II"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I just discovered that empty($test) also says "TRUE" for $test=0.
Now i think i begin to understand what empty() is good for... :)
It gives TRUE if the given value for that given type corresponds to the
value of 0. Unset variables are supposed to also have a value of 0. A
string value of "0" isn't considered as empty - but "if ($test)" results
in FALSE (is this intentional?).
For me, this all makes things not _so_ easy, if all i want to ensure is
to catch POSTed form vars and distinguish between fields not filled and
fields filled with "0"...
yours, Jan
- Next message: rasmus: "[PHP-DEV] CVS update: php3/functions"
- Previous message: Rasmus Lerdorf: "Re: [PHP-DEV] Bug #417: silent (?) change in variable's value behaviour"
- In reply to: Zeev Suraski: "Re: [PHP-DEV] Bug #417: silent (?) change in variable's value behaviour"
- Next in thread: Zeev Suraski: "[PHP-DEV] Re: empty() II"
- Reply: Zeev Suraski: "[PHP-DEV] Re: empty() II"
- Reply: Rasmus Lerdorf: "Re: [PHP-DEV] empty() II"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

