You are here: Re: Type of Data Returned by a Function « PHP Programming Language « IT news, forums, messages
Re: Type of Data Returned by a Function

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация