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.2.31 - 8.2.34, 8.3.0 - 8.3.35
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.
Output for 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
Constant [ string DEMO ] { f } string(4) "foo"
Output for 8.4.24 - 8.4.26, 8.5.9 - 8.5.11
Constant [ string DEMO ] { foo } string(4) "foo"

preferences:
33.73 ms | 1165 KiB | 15 Q