mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-05-22 06:10:58 +00:00
Update function declarations to adhere to PSR-2 standards
This commit is contained in:
parent
fa03534bb8
commit
91da073b45
@ -327,7 +327,7 @@ echo my_function(); // => "Hello"
|
|||||||
// A valid function name starts with a letter or underscore, followed by any
|
// A valid function name starts with a letter or underscore, followed by any
|
||||||
// number of letters, numbers, or underscores.
|
// number of letters, numbers, or underscores.
|
||||||
|
|
||||||
function add($x, $y = 1) { // $y is optional, and defaults to 2
|
function add ($x, $y = 1) { // $y is optional and defaults to 1
|
||||||
$result = $x + $y;
|
$result = $x + $y;
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user