3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern='/^(\p{Pd}+\s*2\.2\.|2\.2\.)/mu'; $texts = array( "– 2.2.04 R", "–– 2.2.04.10 C", "–– 2.2.04.1 CO", "–– 2.2.04.2 CO", "–– 2.2.04.3 CO", "–– 2.2.04.4 CO", "–– 2.2.04.5 CO", "–– 2.2.04.6 CO", "–– 2.2.04.7 CO", "–– 2.2.04.8 CO", "–– 2.2.04.9 CO", "foooooooooooo", "barrrrrrrrrr", "-- foobar", "- 1123", ); foreach($texts as $key=>$text) { if(preg_match($pattern, $text)) { $final_texts[] = $text; } } print_r($final_texts);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => – 2.2.04 R [1] => –– 2.2.04.10 C [2] => –– 2.2.04.1 CO [3] => –– 2.2.04.2 CO [4] => –– 2.2.04.3 CO [5] => –– 2.2.04.4 CO [6] => –– 2.2.04.5 CO [7] => –– 2.2.04.6 CO [8] => –– 2.2.04.7 CO [9] => –– 2.2.04.8 CO [10] => –– 2.2.04.9 CO )

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