October 2006
Intermediate to advanced
720 pages
17h 56m
English
Up to this point, you have experimented with user-defined functions that do not return values. The traditional black-box value of functions is that inputs are processed into meaningful outputs. The outputs are return values from functions. The broadest prototype of a function that returns any data type is
mixed function my_function(mixed var);
This prototype basically says that the function has a single input of a variable that may be any data type and returns a variable of any data type. Unfortunately, many functions work accidentally this way because of careless type management of return values.
Function return types are provided by using the return keyword, a variable or literal value, and a semicolon. You ...
Read now
Unlock full access