Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34410 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7437 invoked by uid 1010); 4 Jan 2008 16:51:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7422 invoked from network); 4 Jan 2008 16:51:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2008 16:51:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia@prohost.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ilia@prohost.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain prohost.org from 64.233.178.241 cause and error) X-PHP-List-Original-Sender: ilia@prohost.org X-Host-Fingerprint: 64.233.178.241 hs-out-0708.google.com Linux 2.4/2.6 Received: from [64.233.178.241] ([64.233.178.241:64441] helo=hs-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8A/F6-63281-A146E774 for ; Fri, 04 Jan 2008 11:51:39 -0500 Received: by hs-out-2122.google.com with SMTP id l65so4549548hsc.7 for ; Fri, 04 Jan 2008 08:51:36 -0800 (PST) Received: by 10.143.17.13 with SMTP id u13mr3863219wfi.69.1199465495845; Fri, 04 Jan 2008 08:51:35 -0800 (PST) Received: from ?192.168.1.133? ( [76.65.228.201]) by mx.google.com with ESMTPS id 26sm26554309wrl.29.2008.01.04.08.51.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2008 08:51:35 -0800 (PST) Cc: Gregory Beaver , Alain Williams , internals Mailing List Message-ID: To: Stefan Esser In-Reply-To: <477E619C.2050107@sektioneins.de> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Fri, 4 Jan 2008 11:51:32 -0500 References: <477DB7BF.10201@chiaraquartet.net> <20080104105558.GC7861@mint.phcomp.co.uk> <477E5649.2080104@chiaraquartet.net> <477E619C.2050107@sektioneins.de> X-Mailer: Apple Mail (2.915) Subject: Re: [PHP-DEV] type hinting From: ilia@prohost.org (Ilia Alshanetsky) 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. 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