3v4l.org

run code in 300+ PHP versions simultaneously
<?php //namespace a; //define('t', true, true); //define('a\\true', false, t); //define('a\\false', t, t); namespace Api\Something { class Foo {} } namespace Api\SomethingElse { define('Api\\SomethingElse\\Private', 'Api\\Something', true); class Bar{ public function run() { //$obj = new Private; var_dump(Api\SomethingElse\Private, $obj); } } }
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Warning: define(): Argument #3 ($case_insensitive) is ignored since declaration of case-insensitive constants is no longer supported in /in/TXj0H on line 15
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'Private' (T_PRIVATE), expecting identifier (T_STRING) in /in/TXj0H on line 21
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_PRIVATE, expecting T_STRING in /in/TXj0H on line 21
Process exited with code 255.

preferences:
98.15 ms | 401 KiB | 84 Q