Re: type hinting
| From: | Stefan Priebsch | Date: | Sun, 06 Jan 2008 20:37:45 +0000 |
| Subject: | Re: type hinting | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34542@lists.php.net to get a copy of this message | ||
I'm a little afraid that introducing type hints will have us end up with code like this (to stick with a previous example):
<?php
function foo(int $a) {}
foo((int) '5');
?>
So, just to make sure, add Java-ish typecasts everywhere. I'm not sure if that solves the problem (error handling still required when the cast is not possible), but maybe someone could comment on the performance implications of adding explicit typecasts in every function 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