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

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

Reply via email to