Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34415 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22149 invoked by uid 1010); 4 Jan 2008 17:05:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22134 invoked from network); 4 Jan 2008 17:05:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2008 17:05:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=sam@sambarrow.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sam@sambarrow.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sambarrow.com from 205.234.132.11 cause and error) X-PHP-List-Original-Sender: sam@sambarrow.com X-Host-Fingerprint: 205.234.132.11 scottsdale.servershost.net Received: from [205.234.132.11] ([205.234.132.11:38517] helo=scottsdale.servershost.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/E9-63281-1576E774 for ; Fri, 04 Jan 2008 12:05:21 -0500 Received: from [98.172.154.66] (port=28927 helo=[10.200.100.14]) by scottsdale.servershost.net with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1JApyq-0004Gw-16; Fri, 04 Jan 2008 11:05:12 -0600 To: Ilia Alshanetsky Cc: Stefan Esser , Gregory Beaver , Alain Williams , internals Mailing List In-Reply-To: References: <477DB7BF.10201@chiaraquartet.net> <20080104105558.GC7861@mint.phcomp.co.uk> <477E5649.2080104@chiaraquartet.net> <477E619C.2050107@sektioneins.de> Content-Type: text/plain Date: Fri, 04 Jan 2008 12:03:38 -0500 Message-ID: <1199466218.15292.144.camel@sbarrow-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - scottsdale.servershost.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sambarrow.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] type hinting From: sam@sambarrow.com (Sam Barrow) On Fri, 2008-01-04 at 11:51 -0500, Ilia Alshanetsky wrote: > To add another two points to Stefan's argument. Type hinting does not > remove the need to filter user input, but it does allow you to safe- > guard internal functions (library code etc...) against accidental or > internal misuse or improper handling of the data in the front-end > layer. It also makes the code far more readable and understandable not > the mention help doc generation tools that interrogate the code. > Exactly, not input, but internal application code. For me a big thing is configuration variables which are then used to call functions. It would also help any other developers looking at your code (easier to understand the purpose of arguments to a functions if it is type hinted). > > On 4-Jan-08, at 11:41 AM, Stefan Esser wrote: > > > Good Morning everyone, > > > > one should not forget that type hinting has some clear advantages the > > anti type hinting advocates always try to forget... > > > > * the code gets smaller because not so many typechecks in every > > function > > * because the code gets smaller it is faster executed (userspace > > typecheck is slower than "engine-space") > > * without all these type checks the code gets easier to read > > * with type hints byte code optimizer can optimize the code far better > > -> faster execution > > * with type hints static analysing tools that check for > > bugs/vulnerabilities can perform far better (intra procedural analysis > > gives more information) > > > > Stefan Esser > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > Ilia Alshanetsky >