Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14817 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56149 invoked by uid 1010); 11 Feb 2005 02:41:37 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56134 invoked from network); 11 Feb 2005 02:41:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Feb 2005 02:41:37 -0000 X-Host-Fingerprint: 80.74.107.235 mail.zend.com Linux 2.4/2.6 Received: from ([80.74.107.235:33011] helo=mail.zend.com) by pb1.pair.com (ecelerity 1.2.11 (r4403)) with SMTP id 7B/12-30997-06B1C024 for ; Thu, 10 Feb 2005 21:41:37 -0500 Received: (qmail 2761 invoked from network); 11 Feb 2005 02:41:33 -0000 Received: from localhost (HELO andi-notebook.zend.com) (127.0.0.1) by localhost with SMTP; 11 Feb 2005 02:41:33 -0000 Message-ID: <5.1.0.14.2.20050210183821.01cb8b10@localhost> X-Sender: andi@localhost X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 10 Feb 2005 18:41:27 -0800 To: Ante Drnasin ,internals@lists.php.net In-Reply-To: <20050210080546.52065.qmail@lists.php.net> References: <20050209164713.GC25360@gravitonic.com> <20050207141916.21665.qmail@lists.php.net> <1062509740.20050209103014@marcus-boerger.de> <20050209110525.1936.qmail@lists.php.net> <20050209164713.GC25360@gravitonic.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Autoboxing in php 5.1 From: andi@zend.com (Andi Gutmans) 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