Re: Type of Data Returned by a Function
- From: Rik <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Sat, 21 Jul 2007 04:25:50 +0200
On Sat, 21 Jul 2007 00:32:06 +0200, Sanders Kaufman <bucky@xxxxxxxxxxx> wrote:
I've noticed that some code analyzers comment that the type of data returned by my functions is "unknown" in the following syntax:
function fnFooBar($aryParameters) {
$bRetVal = True;
return $bRetVal;
}
I *think* I can specify that by doing something like this:
function fnFooBar($aryParameters) bool {
$bRetVal = true;
return $bRetVal;
}
Is this correct?
If so, is there a performance gain, or is it just clean coding?
There is no such construct, all types in php are pretty loose.
The only thing I can think of that might have something to do with what you say are phpdoc comments:
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.return.pkg.html
Which work a treat for building some fast documentation for other coders..
--
Rik Wasmus
.
- Follow-Ups:
- Re: Type of Data Returned by a Function
- From: Sanders Kaufman
- Re: Type of Data Returned by a Function
- References:
- Type of Data Returned by a Function
- From: Sanders Kaufman
- Type of Data Returned by a Function
- Prev by Date: Re: Type of Data Returned by a Function
- Next by Date: Re: Are PHP libraries linked dynamically or statically?
- Previous by thread: Re: Type of Data Returned by a Function
- Next by thread: Re: Type of Data Returned by a Function
- Index(es):
Relevant Pages
|
|