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
> 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to