Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:14746 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1952 invoked by uid 1010); 9 Feb 2005 11:05:25 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 1937 invoked by uid 1007); 9 Feb 2005 11:05:25 -0000 Message-ID: <20050209110525.1936.qmail@lists.php.net> To: internals@lists.php.net Date: Wed, 09 Feb 2005 12:08:08 +0100 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <20050207141916.21665.qmail@lists.php.net> <1062509740.20050209103014@marcus-boerger.de> In-Reply-To: <1062509740.20050209103014@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 193.77.101.32 Subject: Re: [PHP-DEV] Autoboxing in php 5.1 From: ante.dfg@moj.net (Ante Drnasin) Hi Marcus and thanx for the explanation.... And I agree that PHP is very loose which is his strong part but exactly because of that I think it would be nice if the end-user can have the ability to work with primitives like they were objects... I didn't want to suggest that PHP should implement Autoboxing as JAVA but I did like the concept of having objects for primitive types.... Marcus Boerger wrote: > Hello Ante, > > autoboxing is an ugly java 1.5 workarount to enable storage of base > tyoes in containers. There this trick is necessary because as always > in java everything must be an 'Object'. In contrast PHP is a loosly > typed language where a container aka array can store any type. Apart > from that as with java there is no user space enabled way to implement > such autoboxing types and even the java way of building it into the > engine is not supported and won't be. > > regards > marcus > > Monday, February 7, 2005, 3:21:59 PM, you wrote: > > >>I was wondering if anyone can comment on this idea >>cause I think it would be a great asset to PHP and to OOP in PHP.. > > >>example: > > >>$b = 4; >>$a = new Integer(4); > > >>if($a == $b) { >> //bla bla >>} > > >>Other classes would include String(), Integer(), Boolean() ... and so on... > > > > >