MemoryRefresh!

Function / Definition   Definition



Questions Answers 0%

Pages   0 from 91
Questions   0 from 142

Reset


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

Related Pages

Definition
Variables
Anonymous
Reference


0% 100%
 
 
0 pages 91 pages
1) What is the returning value of the function? <?php function Hello() {}





2) Can you pass by reference a variable with default value?





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

References









Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References