3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '<p>Die folgenden Gebühren sind direkt in der Unterkunft zu bezahlen: </p> <ul><li>Kaution: 100 USD pro Tag</li><li>Hotelgebühr: 39.68 USD pro Unterkunft, pro Nacht</li></ul> Die Hotelgebühr enthält: <ul><li>Benutzung des Pools</li><li>Benutzung des Fitnesscenters oder -studios</li><li>Internetzugang</li><li>Telefongespräche</li></ul> <p>Diese Liste enthält alle Gebühren, die uns vom Hotel mitgeteilt wurden. Die erhobenen Gebühren können sich allerdings je nach Buchungszeitraum und Zimmerart ändern. USD 30 </p>'; $pattern = '((?P<precurrency>\w{1,3}) (?:\d{1,3}[,\.]?)+\d* (?P<postcurrency>\w{1,3}) )'; preg_match_all($pattern, $text, $currency); var_dump($currency);
Output for 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.4, 8.3.6 - 8.3.7
array(5) { [0]=> array(0) { } ["precurrency"]=> array(0) { } [1]=> array(0) { } ["postcurrency"]=> array(0) { } [2]=> array(0) { } }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 array(5) { [0]=> array(0) { } ["precurrency"]=> array(0) { } [1]=> array(0) { } ["postcurrency"]=> array(0) { } [2]=> array(0) { } }

preferences:
181.99 ms | 402 KiB | 218 Q