3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $prodQueryResult =array('PRODUCT1'=>'prod1','QUANTITY1'=>'quan1','PRODUCT2'=>'prod2','QUANTITY2'=>'quan2','PRODUCT3'=>'prod3','QUANTITY3'=>'quan3','PRODUCT4'=>'prod4','QUANTITY4'=>'quan4','PRODUCT5'=>'prod5','QUANTITY5'=>'quan5','PRODUCT6'=>'prod6','QUANTITY6'=>'quan6','PRODUCT7'=>'prod7','QUANTITY7'=>'quan7'); $i=6; foreach($prodQueryResult as $prod) { $count=$i; $p = "PRODUCT".$i; $q = "QUANTITY".$i; //echo $q."\n"; echo $prod."\n"; $i++; }

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

Output for Typed properties v2
prod1 quan1 prod2 quan2 prod3 quan3 prod4 quan4 prod5 quan5 prod6 quan6 prod7 quan7
Output for Array change keys
prod1 quan1 prod2 quan2 prod3 quan3 prod4 quan4 prod5 quan5 prod6 quan6 prod7 quan7
Output for Lexical anon
prod1 quan1 prod2 quan2 prod3 quan3 prod4 quan4 prod5 quan5 prod6 quan6 prod7 quan7

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