Introduced in PHP 7: scalar types

Code
<?php

$foo 
= function (int $val1float $val2) : string {
    
var_dump($val1$val2);
    return 
$val1 $val2;
};

var_dump($foo('4'6));
Result
int(4)
float(6)
string(2) "10"
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6