PHP Functions
BeginnerComplete the PHP function declarations.
To declare a function: add($a, $b) { return $a + $b; }
To specify a return type: function add(int $a, int $b): { ... }
To give a parameter a default value: function greet(string $name = ) { ... }
An anonymous function: $fn = ($x) { return $x * 2; };