<?php
class Testi {
public $temp;
function __construct(string $testi){
$this->temp = $testi;
}
}
$testiA = new Testi('A');
$testiB = new $testiA('B');
var_dump($testiA === $testiB);
Catchable fatal error: Argument 1 passed to Testi::__construct() must be an instance of string, string given, called in /in/NqPlO on line 11 and defined in /in/NqPlO on line 5
Process exited with code 255.