<?php
namespace Sandbox;
class Sandbox {
private Connectors\ISandboxConnector $connection;
public function __construct(Connectors\ISandboxConnector $conn) {
$this->connection = $conn;
}
}
?>
For the above code I'm getting the following error:
Parse error: syntax error, unexpected 'Connectors' (T_STRING), expecting variable (T_VARIABLE)
When I remove the type hinting and var_dump
that $connection variable, it will be private Sandbox\Sandbox
and not Sandbox\Connectors\ISandboxconnector
, why?