3v4l.org

run code in 300+ PHP versions simultaneously
<?php $urls = [ 'http://site.ru/question/new/', 'http://site.ru/2015/' ]; $result = []; foreach ($urls as $url) { if (preg_match('#http://site\.ru/\d+/#i', $url)) { $result['year'] = $url; continue; } if (preg_match('#http://site\.ru/question/.*#i', $url)) { $result['question'] = $url; continue; } } var_dump($result);
Output for rfc.property-hooks, git.master, git.master_jit
array(2) { ["question"]=> string(28) "http://site.ru/question/new/" ["year"]=> string(20) "http://site.ru/2015/" }

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:
42.85 ms | 2068 KiB | 4 Q