3v4l.org

run code in 300+ PHP versions simultaneously
<?php class testClass { protected $config; public function getConfiguration() { $this->config = new section; } public function __get($name) { echo "magic method has been called, name is $name\n"; $method = "get".ucfirst($name); return method_exists($this, $method) ? $this->$method() : null; } public function test() { var_dump(empty($this->configuration->name)); var_dump($this->configuration); } } class section { protected $vars; public function __contstruct() { $this->vars = [ 'name' => 1, 'val' => 2 ]; } public function __get($name) { return isset($this->vars[$name]) ? $this->vars[$name] : null; } public function __isset($name) { return isset($this->vars[$name]); } } $a = new testClass; $a -> test();
Output for git.master_jit, git.master, rfc.property-hooks
magic method has been called, name is configuration bool(true) magic method has been called, name is configuration NULL

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:
56.1 ms | 401 KiB | 8 Q