-2
In PHP you don’t have to put a type, you’re just instantiating an Object. In a way, the type would be "Object". And then you’ll instantiate an object in that variable.
The example Luis gave above is right. But you have to import the class on the page.. if you’re using namespace, it looks something like this:
<?php
require_once __DIR__ . '/../vendor/autoload.php';
namespace Caminho\Pasta;
use Caminho\Pasta\Dado;
class JogoDeDados {
private $Dado1;
private $Dado2;
public function __construct() {
$this->Dado1 = new Dado();
$this->Dado2 = new Dado();
}
}
Or use "require" to find the location of the "Data" class".