3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(preg_replace('/^(?<=-)?(0+)/', "" , "-0010px"));
based on krgvI
Output for 5.3.19 - 5.3.29, 5.4.9 - 5.6.30, hhvm-3.10.1 - 3.17.3, 7.0.0 - 7.2.0
string(7) "-0010px"
Output for 4.3.11 - 5.3.18, 5.4.0 - 5.4.8
Warning: preg_replace(): Compilation failed: nothing to repeat at offset 7 in /in/pEUgn on line 4 NULL
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: nothing to repeat at offset 7 in /in/pEUgn on line 4 NULL