3v4l.org

run code in 200+ PHP versions simultaneously
<?php $test_array = array('Element 1', 'Element 2', 'Element 3', 'Element 4', 'Element 5', 'Element 6'); $infArray = array(1, 2, 3); $arrayIterator = new ArrayIterator($infArray); var_dump($arrayIterator->current()); $infiniteIterator = new InfiniteIterator(new ArrayIterator($infArray)); var_dump($infiniteIterator->current()); foreach($test_array as $test){ echo $test . ' ' . $infiniteIterator->current() . '<br/>' . PHP_EOL; $infiniteIterator->next(); } echo phpversion();

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

Output for branch php-master
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 8.0.0-dev
Output for branch php-master+opcache
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 8.0.0-dev
Output for branch php-master+jit
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 8.0.0-dev
Output for Typed properties v2
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 7.4.0-dev
Output for Arrow functions
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 7.2.0-dev
Output for Object typehint
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 7.2.0-dev
Output for Array change keys
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 7.1.0-dev
Output for Lexical anon
int(1) NULL Element 1 <br/> Element 2 2<br/> Element 3 3<br/> Element 4 1<br/> Element 5 2<br/> Element 6 3<br/> 7.0.0-dev

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