3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class A { public function __construct(public readonly int $myProp) {} } class B extends A { // This should be reported as an error, as a readonly prop cannot be redeclared. public function __construct(public readonly int $myProp) { } } $foo = new B(7);
Output for 8.1.11 - 8.1.34, 8.2.21 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3

preferences:
53.52 ms | 728 KiB | 4 Q