I have problems defining datatypes for my method arguments (PHP 5.2.1).
I have this piece of code:
Code: Select all
<?php
myclass::test(1);
class myclass {
public static function test(int $number) {
echo "success";
}
}
?>"Catchable fatal error: Argument 1 passed to myclass::test() must be an instance of int, integer given, called in test.php on line 2 and defined in test3.php on line 5"
What is wrong?
string doesn't work either.
Isn't it possible to set datatypes in PHP5?