On 13 Jul 2014, at 16:51, Rowan Collins <rowan.coll...@gmail.com> wrote:

> Well, the ability to cast to an object at all is pretty wacky, since PHP has 
> no standard base class for objects, nor any mechanism to cast to or from 
> specific classes, etc.

Somewhat off-topic, but maybe we should make StdClass be the actual base class? 
I mean, it’s already used as a generic object, and you could then put StdClass 
as a type hint if you’re using an object as a key/value store but want to allow 
sophisticated objects to be passed.

Also, we don’t have a mechanism to cast between classes mostly because we don’t 
need it; if Bar extends Foo and a function takes a Foo, it can also take a Bar.
--
Andrea Faulds
http://ajf.me/





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

Reply via email to