3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { public $_themeMap = array( "microsite" => array( "toc" => "microsite", "global-ui" => "microsite" ) ); public function getTOCFromTheme($theme) { if(array_key_exists($theme, $this->_themeMap) && array_key_exists("toc", $this->_themeMap[$theme])) { return $this->$themeMap[$theme]["toc"]; } else { return "default"; } } } echo (new TestClass)->getTOCFromTheme('microsite'); ?>
Output for git.master, git.master_jit
Warning: Undefined variable $themeMap in /in/9VZuj on line 15 Warning: Undefined property: TestClass::$ in /in/9VZuj on line 15 Warning: Trying to access array offset on value of type null in /in/9VZuj on line 15 Warning: Trying to access array offset on value of type null in /in/9VZuj on line 15
Output for rfc.property-hooks
Warning: Undefined variable $themeMap in /in/9VZuj on line 15 Warning: Undefined property: TestClass::$ in /in/9VZuj on line 15 Warning: Trying to access array offset on null in /in/9VZuj on line 15 Warning: Trying to access array offset on null in /in/9VZuj on line 15

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
39.11 ms | 401 KiB | 8 Q