Re: Type hinting - Request for Discussion
| From: | Richard Quadling | Date: | Fri, 10 Jul 2009 14:58:56 +0000 |
| Subject: | Re: Type hinting - Request for Discussion | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-44917@lists.php.net to get a copy of this message | ||
2009/7/10 Alain Williams <addw@phcomp.co.uk>:
>
> Just to add a little fuel to this fire, should we allow the specification of return
> type of functions, eg:
>
> function int Factorial(int $num) {...}
>
> What about things that return FALSE on error, eg fgets(), something like this:
>
> function (string, bool) fgets(resource $handle, int $length) { ... }
>
> I suspect that it makes things too complicated.
>
> --
> Alain Williams
> Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
> +44 (0) 787 668 0256 http://www.phcomp.co.uk/
> Parliament Hill Computers Ltd. Registration Information:
> http://www.phcomp.co.uk/contact.php
> Past chairman of UKUUG: http://www.ukuug.org/
> #include <std_disclaimer.h>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
This would be the perfect pairing. A library utilizing strict/enforced
types would surely want to indicate explicitly the return type.
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
ZOPA : http://uk.zopa.com/member/RQuadling