Re: Type of Data Returned by a Function



On Jul 20, 6:32 pm, Sanders Kaufman <bu...@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?

You think you can? Did you even try it? If you did you'd quickly
find that you get a syntax error.

That syntax isn't supported by PHP, and, as far as I know, there is no
way to specify the type of data returned. As such, I'm not sure what
your code analyzer expects you to do about it or why it would complain
about it in the first place.

.



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: ... 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: Week number with DatePart syntax, and Server...
    ... I had to use the Datepart syntax. ...     Sub WeekNumJRS'' Tdy is CDate in; Y W D out ... ' To let it return the name of a month, specify 2 digits: ...
    (microsoft.public.scripting.vbscript)
  • 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: neural networks output problem
    ... (syntax of this command varies trough different versions of matlab, at least the first part, but I guess that's not the problem) ... Your syntax is incorrect for either version. ... You didn't specify what version of the Toolbox you are using. ... Your output activation function should either be the default ...
    (comp.soft-sys.matlab)