3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function per2num($per){return $per+1-1;} foreach(array("2%","25%","2.01%","25.00%") as $test) echo $test,":\t",per2num($test),"\r\n";
based on Bbu6k
Output for 7.1.0
2%: Notice: A non well formed numeric value encountered in /in/RDOhJ on line 2 2 25%: Notice: A non well formed numeric value encountered in /in/RDOhJ on line 2 25 2.01%: Notice: A non well formed numeric value encountered in /in/RDOhJ on line 2 2.01 25.00%: Notice: A non well formed numeric value encountered in /in/RDOhJ on line 2 25
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
2%: 2 25%: 25 2.01%: 2.01 25.00%: 25