>>>>> "MM" == Maxim Maletsky <[EMAIL PROTECTED]> writes:
> >>>>> Tim Ward writes:
> >
> > to take this a step further, PHP doesn't seem to have types at all
> > try ...
> >
> > echo 1 + true; // gives 2
> > echo 1 . true; // gives 11
> >
> > true is a constant that seems to equate to 1, false is 0. Or is
> > this just my interpretation?
> You are absolutely right. True = 1 False = 0
> make an if statement, or echo ...
> Cheers, Maxim Maletsky
Ummm... no, PHP does have types. You can see the difference between
true and 1 if you use the === operator in your if statement rather
than ==.
In your examples you were implicitly converting from a boolean type
to an integer or a string. Try this:
print gettype(true) . "<br>\n";
print gettype(0 + true) . "<br>\n";
print gettype('' . true) . "<br>\n";
-robin
--
Robin Vickery.................................................
BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]