3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = "define('DIRNAME_BLOCKS', 'blocks'); define('DIRNAME_BACKUPS', 'backups'); define('DIRNAME_PAGES', 'single_pages'); define('DIRNAME_VIEWS', 'views'); define('DIRNAME_PACKAGES', 'packages'); define('DIRNAME_MODELS', 'models'); define('DIRNAME_ATTRIBUTES', 'attributes'); define('DIRNAME_AUTHENTICATION', 'authentication'); define('DIRNAME_LIBRARIES', 'libraries'); define('DIRNAME_RESPONSE', 'response'); define('DIRNAME_PERMISSIONS', 'permission'); define('DIRNAME_WORKFLOW', 'workflow'); define('DIRNAME_WORKFLOW_ASSIGNMENTS', 'assignments'); define('DIRNAME_REQUESTS', 'requests'); define('DIRNAME_KEYS', 'keys'); define('DIRNAME_PAGE_TYPES', 'page_types'); define('DIRNAME_PAGE_THEME', 'page_theme'); define('DIRNAME_PAGE_THEME_CUSTOM', 'custom'); define('DIRNAME_ELEMENTS', 'elements'); define('DIRNAME_LANGUAGES', 'languages'); define('DIRNAME_JOBS', 'jobs'); define('DIRNAME_DASHBOARD', 'dashboard'); define('DIRNAME_ELEMENTS_HEADER_MENU', 'header_menu'); define('DIRNAME_DASHBOARD_MODULES', 'modules'); define('DIRNAME_MAIL_TEMPLATES', 'mail'); define('DIRNAME_THEMES', 'themes'); define('DIRNAME_THEMES_CORE', 'core'); define('DIRNAME_TOOLS', 'tools'); define('DIRNAME_BLOCK_TOOLS', 'tools'); define('DIRNAME_BLOCK_TEMPLATES', 'templates'); define('DIRNAME_BLOCK_TEMPLATES_COMPOSER', 'composer'); define('DIRNAME_CSS', 'css'); define('DIRNAME_CLASSES', 'src'); define('DIRNAME_PREVIEW', 'preview'); define('DIRNAME_GROUP', 'group'); define('DIRNAME_GROUP_AUTOMATION', 'automation'); define('DIRNAME_JAVASCRIPT', 'js'); define('DIRNAME_IMAGES', 'images'); define('DIRNAME_HELPERS', 'helpers'); define('DIRNAME_USER_POINTS', 'user_point'); define('DIRNAME_ACTIONS', 'actions'); define('DIRNAME_SYSTEM_TYPES', 'types'); define('DIRNAME_SYSTEM_CAPTCHA', 'captcha'); define('DIRNAME_SYSTEM_ANTISPAM', 'antispam'); define('DIRNAME_SYSTEM', 'system'); define('DIRNAME_PANELS', 'panels'); define('DIRNAME_CONTROLLERS', 'controllers'); define('DIRNAME_PAGE_CONTROLLERS', 'single_page'); define('DIRNAME_GATHERING', 'gathering'); define('DIRNAME_GATHERING_DATA_SOURCES', 'data_sources'); define('DIRNAME_GATHERING_ITEM_TEMPLATES', 'templates'); define('DIRNAME_COMPOSER', 'composer'); define('DIRNAME_ELEMENTS_PAGE_TYPES_PUBLISH_TARGET_TYPES', 'target_types'); define('DIRNAME_COMPOSER_ELEMENTS_CONTROLS', 'controls'); define('DIRNAME_ELEMENTS_PAGE_TYPES_PUBLISH_TARGET_TYPES_FORM', 'form'); define('DIRNAME_CONVERSATIONS', 'conversation'); define('DIRNAME_CONVERSATION_EDITOR', 'editor'); define('DIRNAME_VENDOR', 'vendor'); define('DIRNAME_LANGUAGES_SITE_INTERFACE', 'site'); define('DIRNAME_STYLE_CUSTOMIZER', 'style_customizer'); define('DIRNAME_STYLE_CUSTOMIZER_TYPES', 'types'); define('DIRNAME_STYLE_CUSTOMIZER_PRESETS', 'presets'); define('DIRNAME_FILE_STORAGE_LOCATION_TYPES', 'storage_location_types'); define('REL_DIR_FILES_INCOMING', '/incoming'); define('REL_DIR_FILES_THUMBNAILS', '/thumbnails');"; $d = explode("\n", $d); var_dump(array_map(function($val) { return strtolower(preg_replace("/define\\('DIRNAME_(.+?)', '(.+?)'\\)/", '\'\1\' => \'\2\'', $val)); }, $d));
based on HjHYP
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(65) { [0]=> string(21) "'blocks' => 'blocks';" [1]=> string(23) "'backups' => 'backups';" [2]=> string(26) "'pages' => 'single_pages';" [3]=> string(19) "'views' => 'views';" [4]=> string(25) "'packages' => 'packages';" [5]=> string(21) "'models' => 'models';" [6]=> string(29) "'attributes' => 'attributes';" [7]=> string(37) "'authentication' => 'authentication';" [8]=> string(27) "'libraries' => 'libraries';" [9]=> string(25) "'response' => 'response';" [10]=> string(30) "'permissions' => 'permission';" [11]=> string(25) "'workflow' => 'workflow';" [12]=> string(40) "'workflow_assignments' => 'assignments';" [13]=> string(25) "'requests' => 'requests';" [14]=> string(17) "'keys' => 'keys';" [15]=> string(29) "'page_types' => 'page_types';" [16]=> string(29) "'page_theme' => 'page_theme';" [17]=> string(32) "'page_theme_custom' => 'custom';" [18]=> string(25) "'elements' => 'elements';" [19]=> string(27) "'languages' => 'languages';" [20]=> string(17) "'jobs' => 'jobs';" [21]=> string(27) "'dashboard' => 'dashboard';" [22]=> string(40) "'elements_header_menu' => 'header_menu';" [23]=> string(33) "'dashboard_modules' => 'modules';" [24]=> string(27) "'mail_templates' => 'mail';" [25]=> string(21) "'themes' => 'themes';" [26]=> string(24) "'themes_core' => 'core';" [27]=> string(19) "'tools' => 'tools';" [28]=> string(25) "'block_tools' => 'tools';" [29]=> string(33) "'block_templates' => 'templates';" [30]=> string(41) "'block_templates_composer' => 'composer';" [31]=> string(15) "'css' => 'css';" [32]=> string(19) "'classes' => 'src';" [33]=> string(23) "'preview' => 'preview';" [34]=> string(19) "'group' => 'group';" [35]=> string(35) "'group_automation' => 'automation';" [36]=> string(21) "'javascript' => 'js';" [37]=> string(21) "'images' => 'images';" [38]=> string(23) "'helpers' => 'helpers';" [39]=> string(30) "'user_points' => 'user_point';" [40]=> string(23) "'actions' => 'actions';" [41]=> string(26) "'system_types' => 'types';" [42]=> string(30) "'system_captcha' => 'captcha';" [43]=> string(32) "'system_antispam' => 'antispam';" [44]=> string(21) "'system' => 'system';" [45]=> string(21) "'panels' => 'panels';" [46]=> string(31) "'controllers' => 'controllers';" [47]=> string(36) "'page_controllers' => 'single_page';" [48]=> string(27) "'gathering' => 'gathering';" [49]=> string(43) "'gathering_data_sources' => 'data_sources';" [50]=> string(42) "'gathering_item_templates' => 'templates';" [51]=> string(25) "'composer' => 'composer';" [52]=> string(61) "'elements_page_types_publish_target_types' => 'target_types';" [53]=> string(43) "'composer_elements_controls' => 'controls';" [54]=> string(58) "'elements_page_types_publish_target_types_form' => 'form';" [55]=> string(34) "'conversations' => 'conversation';" [56]=> string(34) "'conversation_editor' => 'editor';" [57]=> string(21) "'vendor' => 'vendor';" [58]=> string(37) "'languages_site_interface' => 'site';" [59]=> string(41) "'style_customizer' => 'style_customizer';" [60]=> string(36) "'style_customizer_types' => 'types';" [61]=> string(40) "'style_customizer_presets' => 'presets';" [62]=> string(58) "'file_storage_location_types' => 'storage_location_types';" [63]=> string(46) "define('rel_dir_files_incoming', '/incoming');" [64]=> string(50) "define('rel_dir_files_thumbnails', '/thumbnails');" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/vMgJ2 on line 72
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/vMgJ2 on line 72
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/vMgJ2 on line 72
Process exited with code 255.