3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { private $string; public function __constructor(string $string) { $this->string = $string; } } function test_types(Person $person = new Person("string")) { if ($person instanceof Person) { echo "TRUE"; } }
Output for 7.0.0 - 7.0.25, 7.1.0 - 7.1.11
Fatal error: Constant expression contains invalid operations in /in/ePI2d on line 12
Process exited with code 255.

preferences:
169.78 ms | 1395 KiB | 45 Q