Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42315 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72297 invoked from network); 18 Dec 2008 00:03:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Dec 2008 00:03:01 -0000 Authentication-Results: pb1.pair.com header.from=nrixham@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=nrixham@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.20 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: nrixham@gmail.com X-Host-Fingerprint: 209.85.219.20 mail-ew0-f20.google.com Received: from [209.85.219.20] ([209.85.219.20:47323] helo=mail-ew0-f20.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/54-48223-43399494 for ; Wed, 17 Dec 2008 19:03:01 -0500 Received: by ewy13 with SMTP id 13so188297ewy.23 for ; Wed, 17 Dec 2008 16:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=kGYOE9eMLnGkmeWfn0Xisuu17yBTbl2BXpN5m/EByiU=; b=ecvH4OT2NylOP17KkrnXaX7haRmqUVkk1zMENK9sTk4e87lAAk5lZGGvBQg2BWfzys LuTwx3ha0aJ+M9xxYGzXt3rIDAA9Ne6V1yydpwJiTFNvHKiDveXBEJ2zGNpN3z/9I+kP AASv5MjSQcYjXnmes8npvkeKVpSjPC815H/hQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=ZTAxVp8scw14z0suFjRCWixRAUJAKfRirFRgXLfD0JZCJfVKMklwRUcGlYyObCB38C o38PHlQ702LB6M7phSiHJXLLdp8YdEXDAckY6+zuPpE7B44Nj38UfpIAkf7fyoY2cJF4 DkWMlgOUkLacbGt4nJtQ8kG0RacpcUvxk4xic= Received: by 10.210.87.19 with SMTP id k19mr1551555ebb.109.1229558577034; Wed, 17 Dec 2008 16:02:57 -0800 (PST) Received: from ?192.168.2.6? (82-41-135-70.cable.ubr02.grth.blueyonder.co.uk [82.41.135.70]) by mx.google.com with ESMTPS id y34sm6302753iky.13.2008.12.17.16.02.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Dec 2008 16:02:56 -0800 (PST) Message-ID: <49499329.3080002@gmail.com> Date: Thu, 18 Dec 2008 00:02:49 +0000 User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: Graham Kelly CC: internals@lists.php.net References: <69.22.48223.7E389494@pb1.pair.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Q on Primitives From: nrixham@gmail.com (Nathan Rixham) Graham Kelly wrote: > Hi, > > I think the reason there aren't more primitive types in PHP is because of > the nature of the language. One of the main features of PHP over say, C (and > even Java), is that the memory managment is completely transparent to the > devloper. This means that it really shouldent matter to the devloper how an > integer is implimented on the machine. Same with doubles and chars. > Granted, I can see some reasons why forcing the data to be of a specific > length or type would be handy, but I dont know if there would be a wide > enough requierment for this to actually impliment it as a language feature. > Plus, you usually can find a way around it anyway :). But basically, if your > interest in byte and char are for conserving memory then dont be worried... > PHP does a fairly good job with your memory and this wouldent actually > translate into a memory savings on the machine. mainly it was for the strictness and for the extra speed gained by having a primitive at php level, to implement using say class Byte (which I have done) is seriously heavy processor and memory wise for something so simple.. especially if you consider an implementation of ByteArray.. obviously there isn't much call otherwise this would have been implemented back at v4 or at least 5; however I for one would love to see this simple little bit of support added. Would open up masses of avenues, including the ability to make some decent orm's for php (much easier to map "byte to byte" than "scalar might be a byte but is really an integer to byte" if you know what I mean. regards!