3v4l.org

run code in 300+ PHP versions simultaneously
<?php function assign_foo($instance) { $instance->foo = 2; } final class Content { protected $data; public function __get(string $name) { return $this->data[$name]; } public function __set(string $name, mixed $value): void { if ($value === 1) { assign_foo($this); } else { $this->data[$name] = $value; } } } set_error_handler(function () { echo (new Exception)->getTraceAsString(); }); $content = new Content(); $content->foo = 1;
Output for git.master, git.master_jit, rfc.property-hooks
#0 /in/YtnAhT(4): {closure}(8192, 'Creation of dyn...', '/in/YtnAhT', 4) #1 /in/YtnAhT(16): assign_foo(Object(Content)) #2 /in/YtnAhT(28): Content->__set('foo', 1) #3 {main}

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:
28.78 ms | 405 KiB | 5 Q