Function / Definition  

Related Pages


0% 100%
0 pages 298 questions
1) Can you pass by reference a variable with default value?

2) What is the returning value of the function? <?php function Hello() {}

3) Which is faster?

Function name is not case-sensitive and must not start with a number. <?php function name() {} function Name() {} // Fatal error: Cannot redeclare Name() Note that since return is a language construct and not a function, the parentheses surrounding its arguments are not required. It is common to leave them out, and you actually should do so as PHP has less work to do in this case. <?php function A() { return (1); } function B() { return 2; // faster } echo A(); // Output: 1 echo B(); // Output: 2 Even if you don't return a value, PHP will still cause your function to return NULL. The concept of "void" functions does not really apply to PHP. <?php function name() {} echo name() === NULL; // Outputs: 1