On Wed, November 19, 2014 19:47, Andrea Faulds wrote: >>> __toString() always errors if it doesn’t return a string, I see no >>> reason to change that. >> But in the other cases it converts strings to numbers. I mean like >> class A {function __toString(){return '10';}} $a = (string) (new A); >> //numeric literal >> > > ? > > > I see no numbers? > Yeah, try_string(new A) == (string)(new A), but try_int(new A) != (int)(string)(new A) in the RFC. Whereby '10' were pretty valid for int, no?
Regards Anatol -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php