Re: type hinting
| From: | Ilia Alshanetsky | Date: | Fri, 04 Jan 2008 16:51:32 +0000 |
| Subject: | Re: type hinting | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34410@lists.php.net to get a copy of this message | ||
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.phpIlia Alshanetsky