3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = [ array( 'id' => '183970', 'player1' => 'Weird', 'player2' => 'Bloodbuddy', 'player1_items' => '644:204,10:200000,', 'player2_items' => '38:200,', ), array ( 'id' => '183969', 'player1' => 'Frog', 'player2' => 'Eh', 'player1_items' => '656:1,11:3797,33:1111,42:200,40:100,31:1111,1263:1,522:1,', 'player2_items' => '405:1,', )]; foreach ($result as $item) { print "Player: {$item["player1"]}\n"; foreach (explode(',', $item['player1_items']) as $player1_item) { if(empty($player1_item)) continue; [$type, $qty] = explode(":", $player1_item); print "$type: $qty\n"; } }
Output for git.master_jit, git.master, rfc.property-hooks
Player: Weird 644: 204 10: 200000 Player: Frog 656: 1 11: 3797 33: 1111 42: 200 40: 100 31: 1111 1263: 1 522: 1

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