Return type declarations
• Same types as for argument type declarations
• function sum(int $a, int $b):int {
return $a + $b
}
Slide 5
Slide 5 text
Null coalesce operator
??
• Because we are lazy and other languages have it
• $u = isset($_GET['user']) ? $_GET['user'] : 'nobody';
becomes
$u = $_GET['user'] ?? 'nobody';