Re: Type of Data Returned by a Function



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
.



Relevant Pages

  • Re: Type of Data Returned by a Function
    ... returned by my functions is "unknown" in the following syntax: ... I *think* I can specify that by doing something like this: ... find that you get a syntax error. ... your code analyzer expects you to do about it or why it would complain ...
    (comp.lang.php)
  • Re: Type of Data Returned by a Function
    ... Rik wrote: ... returned by my functions is "unknown" in the following syntax: ... The only thing I can think of that might have something to do with what you say are phpdoc comments: ...
    (comp.lang.php)
  • Re: ldp Constraints Violation in modifying password
    ... Constraint violation on a pwd modify operation usually means that you either ... didn't specify the password in the right syntax or violated password policy. ... Use the same syntax as above to specify the value. ...
    (microsoft.public.windows.server.active_directory)
  • Re: warn about implicit SAVE?
    ... like it was with the comparable code in f77. ... different syntax). ... Making the variable usaved doesn't achieve can turn a valid program into ... Perhaps you could specify that his would also happen, ...
    (comp.lang.fortran)
  • Re: S-function Builder and Dynamic Arrays
    ... unknown size (ie a dynamic array) as input. ... column where you are supposed to specify the row size but if this is ... But I doubt the SFunction builder wizard supports this. ...
    (comp.soft-sys.matlab)