Re: [PHP-DEV] $string != $array should throw a warning! From: Stanislav Malyshev (stas <email protected>)
Date: 12/28/99

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 <email protected>          
+972-3-6139665

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>