3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json_data = array ( 'data' => array ( 0 => array ( 'title' => 'currency1', 'tickers' => array ( 0 => 'USD' ), ), 1 => array ( 'title' => 'currency2', 'tickers' => array ( 0 => 'USD', 1 => 'EUR' ), ), 2 => array ( 'title' => 'currency3', 'tickers' => array ( 0 => 'USD' ), ) ) ); foreach ($json_data['data'] as $key => $story) { $tickers = $story['tickers']; if (count($tickers) != 1) continue; $title = $story['title']; echo "$title Key is $key and tickers is {$tickers[0]}\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
currency1 Key is 0 and tickers is USD currency3 Key is 2 and tickers is USD

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