On 10.07.2009, at 13:20, Lewis Wright wrote:

3)      function Foo(is_int($x)) {

Function is_int is called, an error is raised if it returns false.


But then you're complicating it to the point where it's no longer much more useful than just calling the is_numeric method in the function body. Plus
there's no longer the advantage of optimisers knowing the data-type.


right .. lets not forget the original goal (though it hasnt been perfectly defined) the idea was to move common validation code out of the function body to reduce code, increase readability and enable IDE's to be even smarter. moving the function body into the signature was not the plan, as it will kill the above features for the sake of flexibility. the point is not flexibility, its finding a sensible common denominator for validation of input parameters and optimizing the syntax for that case.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org




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

Reply via email to