3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = $db->query('SELECT * FROM table.logs ORDER BY time DESC LIMIT 2'); while ($item = $db->fetch_assoc($result)) { /* data (var_export) 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,', ) */ $player1_items = explode(':', $item['player1_items']); foreach ($player1_items as $key => $value) { echo $value; } }
Output for git.master_jit, git.master, rfc.property-hooks
Warning: Undefined variable $db in /in/FUf1I on line 3 Fatal error: Uncaught Error: Call to a member function query() on null in /in/FUf1I:3 Stack trace: #0 {main} thrown in /in/FUf1I on line 3
Process exited with code 255.

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