3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { public const MAX_LARGE_LENGTH_BYTES = 1024 + 1; // 1 KiB + 1 % public const MAX_LARGE_LENGTH_BYTES2 = (int) (1024 * 1.01); } var_dump(Foo::MAX_LARGE_LENGTH_BYTES); var_dump(Foo::MAX_LARGE_LENGTH_BYTES2);
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.19, 8.4.1 - 8.4.5
Fatal error: Constant expression contains invalid operations in /in/OVu3r on line 8
Process exited with code 255.

preferences:
168.84 ms | 1003 KiB | 7 Q