3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (!function_exists('nice_number')) { function nice_number1($n) { // first strip any formatting; $n = (0 + str_replace(",", "", $n)); // is this a number? if (!is_numeric($n)) return false; // now filter it; $str = ''; if ($n > 1000000000000) { $str = round(($n / 1000000000000), 0) . ' tn '; $str .= $n % 1000000000000 > 0 ? nice_number($n % 1000000000000) : ''; return $str; } else if ($n > 1000000000) { $str = round(($n / 1000000000), 0) . ' bn '; $str .= $n % 1000000000 > 0 ? nice_number($n % 1000000000) : ''; return $str; } else if ($n > 1000000) { $str = round(($n / 1000000), 0) . ' mn '; $str .= $n % 1000000 > 0 ? nice_number($n % 1000000) : ''; return $str; } else if ($n > 1000) return round(($n / 1000), 0) . ' K '; return number_format($n); } } echo nice_number(1300200000);
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined function nice_number() in /in/AqFhA:35 Stack trace: #0 {main} thrown in /in/AqFhA on line 35
Process exited with code 255.
Output for 5.0.0 - 5.6.21, hhvm-3.10.0 - 3.12.0
Fatal error: Call to undefined function nice_number() in /in/AqFhA on line 35
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: nice_number() in /in/AqFhA on line 35
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: nice_number() in /in/AqFhA on line 35
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: nice_number() in /in/AqFhA on line 35