| 04 - Function Definitions |
| Mambo Coding Standards | |
| Mar 03, 2007 at 10:39 AM | |
|
Function declarations follow the "one true brace" convention:
<?php
function fooFunction( $arg1, $arg2 = '' ){
if (condition) {
statement;
}
return $val;
}
?>
Arguments with default values go at the end of the argument list.
Always attempt to return a meaningful value from a function if one is
appropriate. <?php The opening brace is written on the same line as the function declaration. The closing brace is always written on its own line. Any content within the braces should be indented. |
|
| <Previous | Next> |
|---|
