3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $reg = '/^([^\-]?)((?!0)[0-9]+)$/smi'; $str = '-20'; echo preg_replace($reg, '', $str);
Output for 4.3.0 - 7.2.0
-20