3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ '00.12', '0.12', '00', '0', '0012.12', '00023', ]; foreach ($tests as $test) { echo $test . (preg_match('~^(?:[1-9]\d*|0{1,2})(?:\.\d{2})?$~', $test) ? ' pass' : ' fail') . "\n"; }

preferences:
27.87 ms | 404 KiB | 5 Q