3v4l.org

run code in 500+ PHP versions simultaneously
<?php define('foo', 'foo', true); define('bar', 'bar', false); echo foo, FOO, bar, BAR;
Output for 8.6.0
Deprecated: define(): Argument #3 ($case_insensitive) is ignored and treated as false since declaration of case-insensitive constants is no longer supported, passing the argument explicitly is unnecessary in /in/p03K9 on line 3 Warning: define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported, this will be an error in PHP 9.0 in /in/p03K9 on line 3 Deprecated: define(): Argument #3 ($case_insensitive) is ignored and treated as false since declaration of case-insensitive constants is no longer supported, passing the argument explicitly is unnecessary in /in/p03K9 on line 4 foo Fatal error: Uncaught Error: Undefined constant "FOO" in /in/p03K9:6 Stack trace: #0 {main} thrown in /in/p03K9 on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.13
Warning: define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported in /in/p03K9 on line 3 foo Fatal error: Uncaught Error: Undefined constant "FOO" in /in/p03K9:6 Stack trace: #0 {main} thrown in /in/p03K9 on line 6
Process exited with code 255.
Output for 7.4.0 - 7.4.33, 7.3.0 - 7.3.31
Deprecated: define(): Declaration of case-insensitive constants is deprecated in /in/p03K9 on line 3 foo Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "foo" in /in/p03K9 on line 6 foobar Warning: Use of undefined constant BAR - assumed 'BAR' (this will throw an Error in a future version of PHP) in /in/p03K9 on line 6 BAR
Output for 7.3.32 - 7.3.33, 7.2.0 - 7.2.33
foofoobar Warning: Use of undefined constant BAR - assumed 'BAR' (this will throw an Error in a future version of PHP) in /in/p03K9 on line 6 BAR
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
foofoobar Notice: Use of undefined constant BAR - assumed 'BAR' in /in/p03K9 on line 6 BAR

preferences:
22.16 ms | 1183 KiB | 6 Q