Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37073 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57581 invoked from network); 17 Apr 2008 15:29:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2008 15:29:57 -0000 Authentication-Results: pb1.pair.com header.from=paul.biggar@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=paul.biggar@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.162.178 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: paul.biggar@gmail.com X-Host-Fingerprint: 209.85.162.178 el-out-1112.google.com Received: from [209.85.162.178] ([209.85.162.178:25220] helo=el-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/FA-05127-4FC67084 for ; Thu, 17 Apr 2008 11:29:57 -0400 Received: by el-out-1112.google.com with SMTP id m34so64642ele.13 for ; Thu, 17 Apr 2008 08:29:54 -0700 (PDT) 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:content-transfer-encoding:content-disposition:references; bh=DfIbV1NhrPSJfNbQ1Djbdueui41446MvUkETLYgGwP0=; b=aCMMW4DzVsQlHNmwoTFlHwSM8TWVfoXYRwtCjctqrqUGGWBGDhsS3H5P6O7z6aBasDMHtstWFGcFMgsKU1ybF/2kkWpbBonkLDrRjElWWNXZ3U7N1zgjmkdtVIoIrV3nuXlHhjJvc/czF6ehyP/GtKjcN03d9qD9Nvauf1M7sVM= 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:content-transfer-encoding:content-disposition:references; b=wwG5slM7Mn3t0yydxXMxHTQXkcwXuM2rUb0GY31k168xPdOAwh4tT8HZH5KR9AosQ6+s1Snt/QsJ6wZk9yLWvu5H0Al1pQxPayukC+QblW1F3EZTgfRwoBiOJM5foiFPeHN2SDBe1DvRtpmmHptpRg0fWjW4VoxTLQOfK9PNNfI= Received: by 10.115.16.1 with SMTP id t1mr1570796wai.196.1208446193668; Thu, 17 Apr 2008 08:29:53 -0700 (PDT) Received: by 10.114.255.17 with HTTP; Thu, 17 Apr 2008 08:29:53 -0700 (PDT) Message-ID: Date: Thu, 17 Apr 2008 17:29:53 +0200 To: "Felipe Pena" Cc: internals@lists.php.net In-Reply-To: <1208445852.5366.31.camel@felipe> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46ccd1ab0804170742g142ed562t4f03339da549a820@mail.gmail.com> <1208445852.5366.31.camel@felipe> Subject: Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value) From: paul.biggar@gmail.com ("Paul Biggar") On Thu, Apr 17, 2008 at 5:24 PM, Felipe Pena wrote: > > Thanks for making the change. This is much more consistent. It remains > > that there is no 'scalar' or 'numeric' hint. Are you planning on > > including them? > > No, i'm not planning to do that. Ah, I should have been more specific. I meant to ask for those changes. Can I ask why not? > > I also wonder about allowing NULL for an 'array' type hint. Is this > > acceptable? The patch seems to indicate it is. If so, why is this > > allowed? > > I added yesterday an information about that in the doc: > > "Functions are now able to force parameters to be objects (by specifying > the name of the class in the function prototype) or arrays (since PHP > 5.1). However, if NULL is used as the default parameter value, it will > be allowed as an argument for any later call." That doesnt explain why its allowed. Can you elaborate? Thanks, Paul > > On Thu, Apr 17, 2008 at 4:42 PM, Felipe Pena wrote: > > > Hi. > > > > > > Well, thinking better about the behavior of type hinting, i decided to > > > change the proposal for strict type. I.e. don't accept numeric string > > > as an intenger, etc. > > > > > > If anyone wants use type hinting, i believe that it should be strict. > > > Otherwise, it makes more sense to not use it. > > > > > > Examples, patches and tests: http://wiki.php.net/rfc/typehint > > > > > > > > > -- > > > Regards, > > > Felipe Pena. > > > > > > -- > > > PHP Internals - PHP Runtime Development Mailing List > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > -- > Regards, > Felipe Pena. > > -- Paul Biggar paul.biggar@gmail.com