Converting your C++ code to PHP:
class MyQueue{
private $data;
public function Add($d);
public function Remove();
public function Print();
};
As Thirler explained, PHP is dynamic, so you can pass anything you want to the Add function, and hold whatever values you want in $data. If you really wanted to add some type safety, you would have to pass the type you want to allow to the constructor.
public function __construct($t){
$this->type = $t;
}
Then you can add some checks in other functions using the instanceof operator.
public function Add($d){
if ( !($d instanceof $this->type ){
throw new TypeException("The value passed to the function was not a {$this->type}");
}
//rest of the code here
}
However, it will not come close to the functionality of a statically typed languge that is designed to catch the type errors at compile time.