3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $items = array( 'Enclosure ' => 12.22, 'Old Blood ' => 24.99, 'Metro Redux' => 19.99, 'Unity ' => 22.50, 'Far Cry 4 ' => 38.75, 'COD ' => 33.47, 'Destiny ' => 19.99 ); $total_price = 0; foreach( $items as $name => $price ) { $total_item_price = $price * 1.25; echo $name .' $'. $price . ' => $'. $total_item_price . ' (EGP '. round($total_item_price * 7.8) .')' ."\n"; $total_price = $total_price + $total_item_price; } echo "---------------------------------\n"; echo "Total: ". $total_price ." (EGP ". round($total_price * 7.8) .")";
Output for 4.3.0 - 5.2.0, 5.2.2 - 7.2.0
Enclosure $12.22 => $15.275 (EGP 119) Old Blood $24.99 => $31.2375 (EGP 244) Metro Redux $19.99 => $24.9875 (EGP 195) Unity $22.5 => $28.125 (EGP 219) Far Cry 4 $38.75 => $48.4375 (EGP 378) COD $33.47 => $41.8375 (EGP 326) Destiny $19.99 => $24.9875 (EGP 195) --------------------------------- Total: 214.8875 (EGP 1676)
Output for 5.2.1

Process exited with code 137.