3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo implements Iterator { public function __construct() { $this->position = 0; } function rewind() { $this->position = 0; } function current() { return $this->array[$this->position]; } function key() { return $this->position; } function next() { ++$this->position; } function valid() { return isset($this->array[$this->position]); } static function bar() { return "brap brap"; } } echo foo::bar(); $foo = new foo(); var_dump (foo instanceOf Iterator);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Return type of foo::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/jstr5 on line 13 Deprecated: Return type of foo::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/jstr5 on line 21 Deprecated: Return type of foo::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/jstr5 on line 17 Deprecated: Return type of foo::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/jstr5 on line 25 Deprecated: Return type of foo::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/jstr5 on line 9 brap brap Deprecated: Creation of dynamic property foo::$position is deprecated in /in/jstr5 on line 6 Fatal error: Uncaught Error: Undefined constant "foo" in /in/jstr5:36 Stack trace: #0 {main} thrown in /in/jstr5 on line 36
Process exited with code 255.

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:
36.45 ms | 402 KiB | 8 Q