3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function gen() { return; yield 1; } $append = new \AppendIterator; $append->append(gen()); foreach ($append as $foo) {}

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Arrow functions
Fatal error: Uncaught Exception: Cannot traverse an already closed generator in /in/YC68k:9 Stack trace: #0 /in/YC68k(9): AppendIterator->rewind() #1 {main} thrown in /in/YC68k on line 9
Output for Object typehint
Fatal error: Uncaught Exception: Cannot traverse an already closed generator in /in/YC68k:9 Stack trace: #0 /in/YC68k(9): AppendIterator->rewind() #1 {main} thrown in /in/YC68k on line 9
Output for Array change keys
Output for Lexical anon
Output for Typed properties

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