3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function count_number($n) { // first strip any formatting; $n = (0+str_replace(",","",$n)); // is this a number? if(!is_numeric($n)) return false; // now filter it; if($n>1000000000000) return floor(($n/1000000000000),1).'T'; else if($n>1000000000) return floor(($n/1000000000),1).'G'; else if($n>1000000) return floor(($n/1000000),1).'M'; else if($n>1000) return floor(($n/1000),1).'K'; return number_format($n); } echo count_number("2,454");
based on d4NJc
Output for 5.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Warning: floor() expects exactly 1 parameter, 2 given in /in/0Q3q3 on line 13 K
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.2.17
Warning: Wrong parameter count for floor() in /in/0Q3q3 on line 13 K