There are no concrete plans no. Object casting is typically available to please the static type checker. This concern does not exist in PHP since types are checked at runtime. So my first question would be: Why do you need it ?
Other questions include: what would it do for up-casting, down-casting, and also casting to incompatible objects? How will it handle private properties? Best, On Wed, Apr 24, 2013 at 6:40 PM, Raymond Irving <xwis...@gmail.com> wrote: > Hello, > > Are there any plans to add object type casting support in PHP? > > For example: > $circle = (Circle) ShapeFactory::createShape('circle'); > $circle->radius = 10; > echo $circle->getArea(); > > It would be great if this feature could be added to 5.5 :) > > __ > Raymond Irving > -- Etienne Kneuss http://www.colder.ch