Re: $string != $array should throw a warning!
| From: | Stanislav Malyshev | Date: | Tue, 28 Dec 1999 11:44:06 +0000 |
| Subject: | Re: $string != $array should throw a warning! | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-14081@lists.php.net to get a copy of this message | ||
TCA>> question is:
TCA>> - do we want the warning? or
TCA>> - can we decide on a string being bigger or smaller than an object/array
TCA>> (and implement that in compare_function())
I'd say it's neither bigger not smaller (is meter bigger than hour?) -
it's uncomparable, and as such should spit out at least a warning. I don't
think somebody really needs silent autoconversion in this case - also I
don't think many understand what happens there.
And why $string == $array returns string? Note than
var_dump("a" == (string)array("a"));
var_dump("a" != (string)array("a"));
return both what's expected. So what really happens there?
--
Stanislav Malyshev stas@zend.com
+972-3-6139665