3v4l.org

run code in 300+ PHP versions simultaneously
<?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");
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: floor() expects exactly 1 argument, 2 given in /in/0Q3q3:13 Stack trace: #0 /in/0Q3q3(13): floor(2.454, 1) #1 /in/0Q3q3(18): count_number(2454) #2 {main} thrown in /in/0Q3q3 on line 13
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.76 ms | 401 KiB | 8 Q