3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Testi { public $temp; function __construct(string $testi){ $this->temp = $testi; } } $testiA = new Testi('A'); $testiB = new $testiA('B'); var_dump($testiA === $testiB);
based on WnpL4
Output for 7.0.0 - 7.2.0
bool(false)
Output for 5.3.20 - 5.6.28
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.