3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { private $data = []; public function __set($name, $value) { $this->$name = $value; } public function __isset($name) { return isset($this->$name); } public function __unset($name) { unset($this->$name); } public function __get($name) { return $this->$name; } } $foo = new Foo(); $foo->__set('uno', 'one'); $foo->__set([1], 'two'); var_dump( $foo->uno, $foo->__get([1]) );
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property Foo::$uno is deprecated in /in/Og25S on line 9 Warning: Array to string conversion in /in/Og25S on line 9 Deprecated: Creation of dynamic property Foo::$Array is deprecated in /in/Og25S on line 9 Warning: Array to string conversion in /in/Og25S on line 24 string(3) "one" string(3) "two"

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:
42.24 ms | 1532 KiB | 4 Q