> Von: Paul Dragoonis <dragoo...@gmail.com>
>Gesendet: 16:54 Mittwoch, 30.Januar 2013
 
>
>To be honest, it looks like __toString() was just added in there for the sake 
>of it without any real thought as to what casting an entier SplFileObject to a 
>string. This to me implies the entire object( i.e: the entire file ) should be 
>returned as a string rather than aliasing it to a method because why would you 
>cast something to a string if you can call ->current() anyway.


>
>Since it's been baked into the object for some time now it can't even be 
>changed now.

Would this mean that changing it in PHP 5.5 (or 5.6) would not be an option 
because of the rules of backwards compatibility?

>

>I'd try to avoid this casting magic and stick with ->current() if you actually 
>mean it.

So do I. I mean, I often foreach anyway.
-- hakre


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to