Sam Barrow schrieb:
> If anyone has any objections to a scalar type hint please raise a
> valid point.

Chris Stockton schrieb:
This library would probably have ~300(String) + ~110(Int)
~40(Resource) ~30(Bool) ~10(Float) = 500 less function calls, and much
cleaner code if there was type hinting.

I may be short-sighted here, but does type adding hinting not just push the problem to the library user? In strictly typed languages the compiler enforces type consistency, in PHP any type inconsistency yields a runtime error, thus forcing the library user to explicitly type cast, wrap every library call into a try-catch statement or use a runtime error handler (which in turn can throw an exception, taking us back to try-catch)?

From an overall perspective on the PHP code, I would rather have the type checks _once_ inside the functions/methods, instead of multiple times on every call.

Regards,

Stefan


--
 >e-novative> - We make IT work for you.

 e-novative GmbH - HR: Amtsgericht München HRB 139407
 Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch

 http://www.e-novative.de - GnuPG Key: 0x7DB67F7F

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

Reply via email to