RE: [PHP] different and logic between PHP4 and PHP5
| From: | Ford, Mike | Date: | Thu, 15 Mar 2007 10:30:56 +0000 |
| Subject: | RE: [PHP] different and logic between PHP4 and PHP5 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-250647@lists.php.net to get a copy of this message | ||
On 12 March 2007 23:06, Richard Lynch wrote:
> On Mon, March 12, 2007 1:53 pm, Vieri wrote:
> > The following code:
> >
> > <?php
> > $b="";
> > $c="df";
> > $a=($b and $c);
>
> Why in the world would you use 'and' on two strings?
>
> What is that supposed to even mean?...
>
> Type-cast them to numbers if you want to use 'and'
Why in the world would you use 'and' on two numbers?
What is that supposed to even mean?...
Type-cast them to bool if you want to use 'and'
... ;) ;)
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm