Re: Autoboxing in php 5.1

From: Date: Fri, 11 Feb 2005 02:41:27 +0000
Subject: Re: Autoboxing in php 5.1
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-14817@lists.php.net to get a copy of this message
At 09:08 AM 2/10/2005 +0100, Ante Drnasin wrote: Why not?
Because it would be a great asset to the new OOP model in PHP 5.... Because the new OOP model is great and I don't think it shouldn't stop there.... Because it would be great if the choice is left to the end user... We already have OOP freaks (including this one) and I just love the idea to have something like function Add($a, $b) { return new Float($a+$b); } print(Add(new Integer(5), new Float(5.7)));
I don't think we should support it just because you're an OOP freak and think it's cool. Actually I see no good reason to do it in PHP. A good reason to have it in Java is because it gives you the option to also set it to NULL. In PHP you don't have that problem. It goes very much against the PHP spirit of dynamic typing and just bloats things. (/me having done a huge project in J2EE a while ago where moving from large composite objects using classes like Integers to native types solved serious scalability problems :) Andi

« previous php.internals (#14817) next »