3v4l.org

run code in 300+ PHP versions simultaneously
<?php $readJson = [ [ 'id' => 78, 'name' => 'audi', 'sscat_id' => 59, 'date' => '0000-00-00 00:00:00' ], [ 'id' => 106, 'name' => 'apache', 'sscat_id' => 86, 'date' => '0000-00-00 00:00:00' ], [ 'id' => 16, 'name' => 'asia', 'sscat_id' => 62, 'date' => '0000-00-00 00:00:00' ] ]; $_GET['b'] = 16; // test case for echoing one //$_GET['b'] = 99; // test case for echoing all $names = []; foreach ($readJson as $row) { if ($row['id'] === $_GET["b"]) { $names = [$row['name']]; break; } $names[] = $row['name']; } echo implode(', ', $names);
Output for git.master, git.master_jit, rfc.property-hooks
asia

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:
134.67 ms | 405 KiB | 5 Q