Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42314 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66353 invoked from network); 17 Dec 2008 23:24:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2008 23:24:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=sgkelly4@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=sgkelly4@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.146.178 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: sgkelly4@gmail.com X-Host-Fingerprint: 209.85.146.178 wa-out-1112.google.com Received: from [209.85.146.178] ([209.85.146.178:27093] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/53-48223-C2A89494 for ; Wed, 17 Dec 2008 18:24:29 -0500 Received: by wa-out-1112.google.com with SMTP id j32so82931waf.7 for ; Wed, 17 Dec 2008 15:24:26 -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:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=H2MrzfHPQV65ZFmCnSXz7z39hChLGHnn+te4udvZfxY=; b=JXkVpSq7L4kFmP979g/r113FckP7uHY8wUPxrsfTu2PDLh0tzG1srpq6Q2bMbMKit6 AysS3MooPeoaNsMPYQqQ7Zs6o/HKkXjRt95Rfn2IlmUoKU59L5B2A2PCAKIjZV3Lwd5+ mRErK4qhPokDpeBDkkl3j00gRAr2trCx9Evp0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=t6L0T8CUNgXiOm5juI64/oVXUW1HYLsYWpMg7dNld2oJGTy8LFIyWZjHCXbheNXW+I HoeclYxoV9fjo/1dNXoJFJw8ot361MpYrSzIz4VJZ4uR+cyuo4wdrozuinZh+jYxeqUF A3g1UUr6CX999NWTbAfoPRsIOkBGlDnfwNi1E= Received: by 10.114.181.6 with SMTP id d6mr701260waf.94.1229556266435; Wed, 17 Dec 2008 15:24:26 -0800 (PST) Received: by 10.114.113.13 with HTTP; Wed, 17 Dec 2008 15:24:26 -0800 (PST) Message-ID: Date: Wed, 17 Dec 2008 18:24:26 -0500 To: "Nathan Rixham" Cc: internals@lists.php.net In-Reply-To: <69.22.48223.7E389494@pb1.pair.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7597_29630892.1229556266432" References: <69.22.48223.7E389494@pb1.pair.com> Subject: Re: [PHP-DEV] Q on Primitives From: sgkelly4@gmail.com ("Graham Kelly") ------=_Part_7597_29630892.1229556266432 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. I too would love to see more type hinting :). ~Graham Kelly On Wed, Dec 17, 2008 at 5:57 PM, Nathan Rixham wrote: > Don't want to take up much of you're time, just wondered if anybody could > point me to the reason why some primitives aren't in php. > > Would find it very very useful to have byte, short, long, float, double and > char in php. (primarily byte and char). > > while I'm here I may as well also ask about further adding type hinting for > the existing scalars and array. > > and finally different method signatures such as: > > class Whatever { > public function __construct(Bar b); > public function __construct(Foo f); > public function doSomething(Bar b); > public function doSomething(Foo f); > } > > Regards! > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > ------=_Part_7597_29630892.1229556266432--