3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace GlobalAlliance\Services\Page; use const CONSTANT_NUMBER_ONE; class NavigationStructure { private static $root; private static $list; private static $fullList = array(); private static $fullPaths2NavigationItems = array(); private static $levels2NavigationItems = array(); private static $activeItem = NULL; private static $activeRequestPath = NULL; private static $navigationRoots = array(); static function init() { // For the group guest there are two possible navigations (branded and GA), so we need an array here self::$navigationRoots[CONSTANT_NUMBER_ONE] = array(); } } NavigationStructure::init();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant "CONSTANT_NUMBER_ONE" in /in/Dvq3P:27 Stack trace: #0 /in/Dvq3P(32): GlobalAlliance\Services\Page\NavigationStructure::init() #1 {main} thrown in /in/Dvq3P on line 27
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Undefined constant 'CONSTANT_NUMBER_ONE' in /in/Dvq3P:27 Stack trace: #0 /in/Dvq3P(32): GlobalAlliance\Services\Page\NavigationStructure::init() #1 {main} thrown in /in/Dvq3P on line 27
Process exited with code 255.
Output for 5.6.0 - 5.6.38
Notice: Use of undefined constant CONSTANT_NUMBER_ONE - assumed 'CONSTANT_NUMBER_ONE' in /in/Dvq3P on line 27
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Parse error: syntax error, unexpected 'const' (T_CONST), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in /in/Dvq3P on line 4
Process exited with code 255.

preferences:
286.26 ms | 402 KiB | 368 Q