In PHP 7 are implemented “Scalar Type Declarations”, e.g.:
public function getBalance(): int {
return 555;
}
You need to declare, that you will use strict types:
<?php
declare(strict_types=1);
function sum(int $a, int $b): int {
return $a + $b;
}
sum(1, 2);
?>
More information: https://wiki.php.net/rfc/scalar_type_hints_v5