MemoryRefresh!

Definition



Questions Answers 0%

Pages   0 from 51
Questions   0 from 84

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
Questions

Related pages

Definition !
Variables !
Anonymous !
Reference !


0% 100%
 
 
0 pages 51 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?




Last Review: n/a   Passed: n/a   Reviews: n/a   Next Review: n/a  


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



More from Php

Basics
Variables
Operators
Function
Array
String
Streams
Uncategorized


More from Programming

Php
jQuery




Powered by minte9.com