3v4l.org

run code in 300+ PHP versions simultaneously
<?php $vouchers = array( 1 => 100, 3 => 150, 5 => 100 ); $specials = array( 3 => true ); $discounts = array(); $orders = [200,300,500,1000]; foreach ($orders as $order) { foreach ($vouchers as $voucher) { $discounts[$order][$voucher] = 0; } } var_dump($discounts);
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [200]=> array(2) { [100]=> int(0) [150]=> int(0) } [300]=> array(2) { [100]=> int(0) [150]=> int(0) } [500]=> array(2) { [100]=> int(0) [150]=> int(0) } [1000]=> array(2) { [100]=> int(0) [150]=> int(0) } }

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:
44.48 ms | 402 KiB | 8 Q