3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); const n = "1"; enum Bag: string { case A = n; }
Output for 8.2.0 - 8.2.15, 8.3.0 - 8.3.2
Output for 8.1.0 - 8.1.27
Fatal error: Enum case value must be compile-time evaluatable in /in/sj7Rq on line 8
Process exited with code 255.
Output for 8.0.1 - 8.0.30
Parse error: syntax error, unexpected identifier "Bag" in /in/sj7Rq on line 5
Process exited with code 255.

preferences:
194.28 ms | 1395 KiB | 83 Q