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.4.24, 8.5.9
Constant [ string DEMO ] { foo } string(4) "foo"
Output for 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
Constant [ string DEMO ] { f } string(4) "foo"
Output for 8.2.31 - 8.2.32, 8.3.0 - 8.3.33
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:
44.22 ms | 781 KiB | 4 Q