RE: [PHP] Re: ramble was [PHP] Not sure of my error
| From: | jeremy brand | Date: | Sat, 18 Nov 2000 01:21:06 +0000 |
| Subject: | RE: [PHP] Re: ramble was [PHP] Not sure of my error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26000@lists.php.net to get a copy of this message | ||
This is good for integer values.
If it is zero (0) then it is false, anything else and it is true. If
you have a string in $foo, then you must accept what happens when the
automatic variable conversion takes place.
To do !$foo on a string doesn't even make sense.
-jeremy brand
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
- - - - - - - - - - - - - - - - - - - - - - - - -
I am pleased to see that we have differences. May we together become
greater than the sum of both of us.
-- Surak of Vulcan, "The Savage Curtain", stardate 5906.4
> What about just:
>
> if(!foo) {
> //bla
> }
>
> are there any problems with this?
>
> -----Original Message-----
> From: jeremy brand [mailto:jeremy@nirvani.net]
> Sent: Saturday, 18 November 2000 11:15 AM
> To: Philip Olson
> Cc: Joe Stump; Matt Stone; php-general@lists.php.net
> Subject: Re: [PHP] Re: ramble was [PHP] Not sure of my error
>
>
> On our production servers, we run with no error reporting. This makes
> the most sense, given our situation.
>
> -jeremy brand
>
> Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
> http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for
> more
> - - - - - - - - - - - - - - - - - - - - - - - - -
> I am pleased to see that we have differences. May we together become
> greater than the sum of both of us.
> -- Surak of Vulcan, "The Savage Curtain", stardate 5906.4
>
> On Sat, 18 Nov 2000, Philip Olson wrote:
>
> > Date: Sat, 18 Nov 2000 01:14:53 +0000 (GMT)
> > From: Philip Olson <philip@theprojects.org>
> > To: Joe Stump <joe@earth.care2.com>
> > Cc: Matt Stone <matt@planetveggie.com>, php-general@lists.php.net
> > Subject: Re: [PHP] Re: ramble was [PHP] Not sure of my error
> >
> > > No - it's up to you. Don't use empty() for checking numbers because it
> will
> > > return true if set to 0 - that's my only advice.
> >
> > *nods* although :
> >
> > if ($foo == '0')
> > {
> > echo 'sup';
> > }
> > // will check whatever but 0
> > elseif (empty($foo))
> > {
> > echo 'it';
> > }
> > else
> > {
> > echo 'err';
> > }
> >
> > anyway, is it true that if error checking is set to 'high' that a check
> > such as :
> >
> > if ($foo == '')
> >
> > will or could return an error? i am looking but cannot find this again
> > but remember seeing it in a post about a month ago. not 100% certain but
> > would like to be :-)
> >
> > philip
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>