3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); class RepositoryPreMain { protected $defaultOrderings = []; } class RepositoryPrepared extends RepositoryPreMain { protected array $defaultOrderings = []; } $foo = new RepositoryPrepared();
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.36, 8.3.0 - 8.3.5
Fatal error: Type of RepositoryPrepared::$defaultOrderings must not be defined (as in class RepositoryPreMain) in /in/87EgQ on line 12
Process exited with code 255.
Output for 7.4.0 - 7.4.33, 8.0.0 - 8.0.22
Fatal error: Type of RepositoryPrepared::$defaultOrderings must not be defined (as in class RepositoryPreMain) in /in/87EgQ on line 15
Process exited with code 255.

preferences:
35.63 ms | 1167 KiB | 5 Q