3v4l.org

run code in 200+ PHP versions simultaneously
<?php $array = ['a', 'b', 'c']; foreach ($array as $values[]); var_dump($values);

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
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
Output for branch php-master+opcache
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
Output for branch php-master+jit
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
Output for Typed properties v2
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
Output for Arrow functions
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
Output for Object typehint
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
Output for Array change keys
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }
Output for Lexical anon
array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" }

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