3v4l.org

run code in 200+ 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 - 7.2.6
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 - 7.0.20
2%: 2 25%: 25 2.01%: 2.01 25.00%: 25