3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo implements Iterator { public string $hook { get => 'this is not the correct value'; } private $x = ['foo', 'BAR']; private $cursor = 0; public function current(): string { return $this->x[$this->cursor]; } public function key(): int { return $this->cursor; } public function next(): void { ++$this->cursor; } public function rewind(): void { $this->cursor = 0; } public function valid(): bool { return isset($this->x[$this->cursor]); } } var_dump(iterator_to_array(new Foo()));
Output for rfc.property-hooks
array(1) { ["hook"]=> string(29) "this is not the correct value" }
Output for git.master
Parse error: syntax error, unexpected token "{", expecting "," or ";" in /in/7Al8b on line 4
Process exited with code 255.
Output for git.master_jit
array(2) { [0]=> string(3) "foo" [1]=> string(3) "BAR" }

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:
41.99 ms | 493 KiB | 3 Q