I am doing mostly .NET/Java but now I am doing PHP. I have a class,
class MyClass{
private $data;
public function __construct(object $data) {
$this->data = $data;
}
}
class B{
}
echo new MyClass(new B());
When I call this I am getting this error,
Argument 1 passed to MyClass::__construct() must be an instance of object, instance of B given, called in /run_dir/repl.php(56) : eval()'d code on line 11
In C# the super class is object but don't know why its not work in PHP.