3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currencies = [ 'USD', 'BTC', 'DASH', 'LTC', 'SC', 'STEEM', 'WAVES', 'SNGLS', '1ST', 'BQX', 'ETH', 'PTOY', 'XAUR', ]; $input = [ "BTCUSD", "DASHBTC", "DOGEUSD", "LTCBTC", "LTCUSD", "SCBTC", "STEEMBTC", "WAVESBTC", "SNGLSBTC", "1STBTC", "DASHUSD", "BQXETH", "PTOYETH", "XAURETH", "BTCUSDT", ]; $output=[]; function filterCurrency($doubleCurrency, $key){ global $output; global $currencies; foreach($currencies as $currency){ $pattern = '/^'.$currency. '/'; preg_match($pattern, $doubleCurrency, $matches); if(array_key_exists(0, $matches)){ $output[]=$matches[0]; } } } array_walk_recursive($input, 'filterCurrency'); var_dump($output);
Output for git.master, git.master_jit, rfc.property-hooks
array(14) { [0]=> string(3) "BTC" [1]=> string(4) "DASH" [2]=> string(3) "LTC" [3]=> string(3) "LTC" [4]=> string(2) "SC" [5]=> string(5) "STEEM" [6]=> string(5) "WAVES" [7]=> string(5) "SNGLS" [8]=> string(3) "1ST" [9]=> string(4) "DASH" [10]=> string(3) "BQX" [11]=> string(4) "PTOY" [12]=> string(4) "XAUR" [13]=> string(3) "BTC" }

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:
28.6 ms | 406 KiB | 5 Q