3v4l.org

run code in 300+ PHP versions simultaneously
<?php $prices = array(chr(8364).' 45.000,-', '45 USD', 'CHF 0,77', chr(36).' 23000', 'USD 23000', '46.000,95', '6', '4,3', chr(8364).' 45,00', chr(36).' 46foobar', chr(8364).' 45,-', chr(8364).' 45', chr(8364).' 45,00', '45 '.chr(8364), '45,- '.chr(8364), '45,00 '.chr(8364), '45.000 '.chr(8364), chr(36).' 45.000,--', chr(8364).' 4.000,00', 'hallo welt', '20.00 €'); $currencies = '(?:EUR|USD|GBP|CHF|FR|SFR|\\'.chr(8364).'|\\'.chr(36).'|\\'.chr(163).')'; $price = '(?:(?:(?:[1-9][0-9]{0,2}(?:\.|,)?)+(?:[0-9]{3})|(?:[0-9]|[1-9][0-9]{1,2}))(?:(?:\.|,)(?:[0-9]{2}|\-{1,2}))?)'; $regex = '(?:^|\s+)(?:(?:(?:'.$currencies.'\s?)'.$price.')|(?:'.$price.'(?:\s?'.$currencies.')))(?:\s+|$)'; foreach($prices as $check) { echo str_pad($check, 15, ' ', STR_PAD_RIGHT).' '.(preg_match('/'.$regex.'/i', $check, $match) ? 'matched: ' : 'did not match.').(count($match) ? $match[0] : '')."\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
� 45.000,- matched: � 45.000,- 45 USD matched: 45 USD CHF 0,77 matched: CHF 0,77 $ 23000 matched: $ 23000 USD 23000 matched: USD 23000 46.000,95 did not match. 6 did not match. 4,3 did not match. � 45,00 did not match. $ 46foobar did not match. � 45,- matched: � 45,- � 45 matched: � 45 � 45,00 matched: � 45,00 45 � did not match. 45,- � matched: 45,- � 45,00 � matched: 45,00 � 45.000 � matched: 45.000 � $ 45.000,-- matched: $ 45.000,-- � 4.000,00 matched: � 4.000,00 hallo welt did not match. 20.00 € did not match.

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.2 ms | 402 KiB | 8 Q