3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * yield expression: what is evaluated first: key or value? */ function genkey($key) { echo "(key) $key\n"; return $key; } function value($value) { echo "(value) $value\n"; return $value; } $gen = function() { foreach(range(0, 2) as $i) { yield genkey(chr(65+$i)) => value($i); } }; iterator_to_array($gen());
Output for git.master, git.master_jit, rfc.property-hooks
(key) A (value) 0 (key) B (value) 1 (key) C (value) 2

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:
37.84 ms | 401 KiB | 8 Q