3v4l.org

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