*Please change the title into something that refer into this question since i didn't know what is this should be.
When i read some tutorial i see script like this
function testArray(array $categories) {
var_dump($categories);
}
testArray(array('string'));
The array in function definition make the parameter strict must be array, which i love it.
Then i test this script
function testString(string $string) {
var_dump($string);
}
testString('test');
Why did i get error like this Catchable fatal error: Argument 1 passed to testString() must be an instance of string, string given ....?
I'm pretty sure the parameter is string.
booleanintegerfloatstringScalar types data types.PHP does not support this types hinting.