Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4493 invoked from network); 1 Jul 2009 18:05:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jul 2009 18:05:16 -0000 Authentication-Results: pb1.pair.com header.from=shadda@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=shadda@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: shadda@gmail.com X-Host-Fingerprint: 209.85.219.227 mail-ew0-f227.google.com Received: from [209.85.219.227] ([209.85.219.227:43075] helo=mail-ew0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C4/E2-24906-A55AB4A4 for ; Wed, 01 Jul 2009 14:05:15 -0400 Received: by ewy27 with SMTP id 27so1199025ewy.23 for ; Wed, 01 Jul 2009 11:05:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=DCgzbDNMrtOUceaJXEZMCWEz8Et8IzQMddxD0utaj/k=; b=Lvv71atZAHTRhDMoo6jC9YwP8Y87pXN1EJvbrl5x6S/qzXTOGCJ88SDLovVZzf7Lh2 VrQXYjIueoDESgT7AJidkrBSWKWQpVlblzvM2Jqtijw+6Oq1mY9SqhbMMk4J9IhIcaxU GYtsL3/Oy98XZ90Felv34MUO10UfYPHtWEwHQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=PkWHVrc4eNZglyA3yiKqVgHxKQeqWZJjaoVvv2Ar5axaLwm/9YGB0ldeTqoOU985qO 798kkn4iDY5OztLXUZrtMd2ycBkkARhDnJskcKApjF5jkGYR+1NZlrLOMdK7PAgdtYl/ 1ukOsM/Z7fhbzrO/xg+xuVB36Rer+UOpYzhXU= Received: by 10.216.26.80 with SMTP id b58mr2878204wea.35.1246471511160; Wed, 01 Jul 2009 11:05:11 -0700 (PDT) Received: from mattw-mac.adknowledge.com (nat-216-21-215-250.adknowledge.com [216.21.215.250]) by mx.google.com with ESMTPS id q9sm3445717gve.17.2009.07.01.11.05.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 01 Jul 2009 11:05:10 -0700 (PDT) Cc: Ilia Alshanetsky , PHP internals Message-ID: <90B0F25A-A836-4E0E-A263-1DEA7A7ADDBC@gmail.com> To: Paul Biggar In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Wed, 1 Jul 2009 13:05:05 -0500 References: X-Mailer: Apple Mail (2.935.3) Subject: Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3 From: shadda@gmail.com (Matt Wilson) +1000 * infinity plus one On Jul 1, 2009, at 12:23 PM, Paul Biggar wrote: > Hi Ilia, > > This is great. > > On Wed, Jul 1, 2009 at 5:59 PM, Ilia Alshanetsky > wrote: >> I've taken a few hours this morning to port my 5.2 type hinting >> patch to >> 5.3. In recognition of a need for a more 'flexible' numeric type I've >> introduced (numeric) type hint that would allow bool/int/float data >> types as >> well as a string containing a numeric entity as identified by >> is_numeric_string(). For completion i've also added (scalar) data >> type that >> will allow any scalar data element. > > I think this will go a long way to addressing people's concerns when > this came up previously. > > >> The patch is available here: http://ia.gd/patch/type_hint_53.txt > > I presume the idea is that some people (if they so chose) would want > to type hint every parameter in their program. To facilitate this, I > might suggest a "mixed" hint (like in the docs), and a null hint > (though I'm not sure if it would be called "null" or "unset" or both). > > > Finally, I don't want to ruin this, but last time there was > disagreement over whether numbers should be coerced to the specified > types, or left alone. What does your patch do? > > ie function x (int $x) { echo is_int ($x); } x ("5"); > > > > Thanks, > Paul > > >> It should be noted that this is not the first idea for type hints, >> that >> credit goes to Hannes Magnusson who had posted a similar patch on the >> internals list back in 2006. Also, back in 2008 Felipe Pena wrote a >> type >> hinting patch for PHP that is available on wiki.php.net. >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > > -- > Paul Biggar > paul.biggar@gmail.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >