3v4l.org

run code in 500+ PHP versions simultaneously
<?php define('DEMO', "f\0oo"); $r = new ReflectionConstant('DEMO'); echo $r; var_dump( $r->getValue() );
Output for 8.5.9 - 8.5.13, 8.6.0, 8.4.24 - 8.4.28
Constant [ string DEMO ] { foo } string(4) "foo"
Output for 8.5.0 - 8.5.8, 8.4.1 - 8.4.23
Constant [ string DEMO ] { f } string(4) "foo"
Output for 8.2.0 - 8.2.36, 8.3.0 - 8.3.37
Fatal error: Uncaught Error: Class "ReflectionConstant" not found in /in/Au101:4 Stack trace: #0 {main} thrown in /in/Au101 on line 4
Process exited with code 255.

preferences:
22.96 ms | 1175 KiB | 6 Q