Hello Antony, You did a nice work for the RFC.
However, I have to disagree with the name __assign, because it limits the type casting operation only to assignments. An implicit type casting could very well happen upon calling a function with type hints. Therefore, I would suggest the use of something like __castFrom(mixed $value). Of course, this changes the semantics a little bit: 1. The function has to be static. 2. The function has to return the new object. I would suggest to check out C# implicit casting, which does exactly this thing (in compile-time however). Check this example: http://msdn.microsoft.com/en-us/library/z5z9kes2.aspx This way we don't mess up with the assignment operator. Meanwhile, there is another interesting RFC under discussion (check the thread "Scalar Type Hinting") which seems to be far more promising than overloading the assignment operator. Lazare INEPOLOGLOU Ingénieur Logiciel 2012/2/29 Anthony Ferrara <ircmax...@gmail.com> > Hey all, > > I've created a draft version of the RFC for implementing __castTo() > and __assign(): > > https://wiki.php.net/rfc/object_cast_magic > > It's still a draft, and has a lot more work to do, but I figured this > would be enough to start triggering some discussion (or at least a > little bit more focused discussion). > > > > One plea: Please keep this thread on-topic discussing the RFC and its > implications... > > Thanks! > > Anthony > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >