Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44574 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88631 invoked from network); 1 Jul 2009 17:09:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jul 2009 17:09:25 -0000 Authentication-Results: pb1.pair.com header.from=gwynne@darkrainfall.org; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=gwynne@darkrainfall.org; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain darkrainfall.org from 208.97.132.74 cause and error) X-PHP-List-Original-Sender: gwynne@darkrainfall.org X-Host-Fingerprint: 208.97.132.74 caiajhbdcahe.dreamhost.com Received: from [208.97.132.74] ([208.97.132.74:52355] helo=homiemail-a1.g.dreamhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 72/B1-15456-3489B4A4 for ; Wed, 01 Jul 2009 13:09:24 -0400 Received: from Moonstar.home (pool-71-174-84-161.bstnma.fios.verizon.net [71.174.84.161]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by homiemail-a1.g.dreamhost.com (Postfix) with ESMTP id 45825119DE4 for ; Wed, 1 Jul 2009 10:09:20 -0700 (PDT) Message-ID: To: PHP internals 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:09:18 -0400 References: X-Mailer: Apple Mail (2.935.3) Subject: Re: [PHP-DEV] RFC: Type hinting revisited for PHP 5.3 From: gwynne@darkrainfall.org (Gwynne Raskind) On Jul 1, 2009, at 12:59 PM, Ilia Alshanetsky wrote: > There has been quite a bit of discussion on this list, IRC, > developer meetings, etc... about introduction of type hinting to > PHP. Most people appear to think that this would be a good idea, but > there is a reason why it is not in PHP already. The main source of > conflict appears to be that in some cases typical type hinting is > just too strict for PHP's typeless nature (most people expect that > "1" == 1, while int type hint would definitely reject string "1"). > Personally, I disagree with that opinion, but I can understand > people who raise that issue. At work we've been using PHP 5.2 with > type hinting for nearly 2 years now with great success, it makes > code much easier to read and understand and the security benefit of > type hinting is not to be under valued. In many cases type hinting > can present a last line of defense against unexpected input for > numeric fields, which are typically abused to do SQL injection. [snip] > My hope is that the latest changes will allow this to become a > standard part of PHP. +1 (+1000, actually :) -- Gwynne