Hi guys, have a bit of a problem here. Hope someone can help me out:
public function __construct()
public static function Apple(int $a)
And its giving me the following error: “Argument 1 passed to Test::Apple() must be an instance of int, integer given, called in…”
Any help appreciated.
btw, unless you are strict on it being an integer, you don’t need the “int” keyword in the function variable definition.
Hope that helps,
I tried casting it to an integer without luck. After some searching, I think it seems that PHP does not support type-hinting for the standard data types (int, doubles), but does support type-hinting of objects (phew!).
Any other opinions appreciated!