Posted by Toby A Inkster on 07/21/07 02:08
Sanders Kaufman wrote:
> function fnFooBar($aryParameters) bool {
> $bRetVal = true;
> return $bRetVal;
> }
>
> Is this correct?
No -- PHP doesn't have any method for declaring a function's return type.
(As of PHP 5 there is a limited facility for declaring the types of
parameters a function accepts, but still nothing for the return type.)
Your "code analyzers" might be able to determine return type using a
phpDoc-style comment. (Google: phpDoc.)
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 30 days, 5:45.]
Parsing an HTML Table with PEAR's XML_HTTPSax3
http://tobyinkster.co.uk/blog/2007/07/20/html-table-parsing/
[Back to original message]
|