3v4l.org

run code in 300+ PHP versions simultaneously
<?php $css = ' .some_class { font-size: 11px; margin-left: 0.45px; margin-top:11.0005px; border: 1.1px solid blue; } .another_class { background: rgba(0, 0, 0, 0.2); width: 100%; color: #012345; z-index: 12; font-size: calc(100% + 888.888px); }'; $pattern = "/\b\d{1,4}(?:\.\d{1,4})?px/"; var_export(preg_match_all($pattern, $css, $matches) ? $matches[0] : 'fail');
Output for 7.1.0 - 7.1.33, 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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.16, 8.5.0 - 8.5.1
array ( 0 => '11px', 1 => '0.45px', 2 => '11.0005px', 3 => '1.1px', 4 => '888.888px', )

preferences:
186.78 ms | 408 KiB | 5 Q