3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fileContent = '12em\n1.3 em'; echo preg_replace_callback('/([0-9,-\.]+)\s*(em)/', 'replace_em', $fileContent); function replace_em($value) { return $value[0] * 123 . 'em'; }
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/LAHmC on line 6 Notice: A non well formed numeric value encountered in /in/LAHmC on line 6 1476em\n159.9em
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.0.14
1476em\n159.9em