Re: SimpleXML & Casting to String
| From: | Andi Gutmans | Date: | Sun, 29 Feb 2004 17:46:27 +0000 |
| Subject: | Re: SimpleXML & Casting to String | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8258@lists.php.net to get a copy of this message | ||
At 12:36 29/02/2004 -0500, Sterling Hughes wrote:
Because it's much more complicated than just changing convert_to_string_ex(). You have to modify all comparison operators to support this and god knows what else. AndiThe problem is that user-land overloading can't be supported. C extensions might be able to be supported but I don't think it's a good idea to start hacking this into PHP. It wouldn't end at the comparison operator but people would want it to work everywhere.I don't want user overloading - I've been consistently against that for objects of all types. I want it internally cause its important to be able to overload all operations for something like SimpleXML to properly work. The same applies to ext/mono (has the same issues as java, but even more due to field and property distinctions.)Right - what I don't understand is that why doesn't convert_to_string_ex() handle this?My concern lies more with functions like utf8_encode() not properly getting the contents of the XML string - but I haven't looked into it too much - I'll try and get some hacking done on the cruise.The way to do it today is to do a cast to (string) although I admit it's not a beautiful solution.