3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); error_reporting(E_ALL); enum blub: string { case ONE = 'one'; case TWO = 'two'; } $array = [ blub::ONE => 'one', blub::TWO => 'two', ];
Output for 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.13, 8.6.0
Fatal error: Uncaught TypeError: Cannot access offset of type blub on array in /in/a8Uf5:12 Stack trace: #0 {main} thrown in /in/a8Uf5 on line 12
Process exited with code 255.
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.35
Fatal error: Uncaught TypeError: Illegal offset type in /in/a8Uf5:12 Stack trace: #0 {main} thrown in /in/a8Uf5 on line 12
Process exited with code 255.

preferences:
28.54 ms | 1167 KiB | 6 Q