function calculate(
$qty,
$price
) {
return (int)$qty * (float)$price;
}function calculate(
int $qty,
float $price
): float {
return $qty * $price;
}function getName(User $user)
{
return $user->name;
}function getName(User $user): string
{
return $user->name;
}$username = isset($_GET['user'])
? $_GET['user']
: 'guest';$username = $_GET['user'] ?? 'guest';usort($a, function ($x, $y) {
if ($x == $y) {
return 0;
}
return ($x < $y) ? -1 : 1;
});usort($a, function ($x, $y) {
return $x <=> $y;
});