3v4l.org

run code in 300+ PHP versions simultaneously
<?php function prettynum($num, $dollar = null) { global $mtgdb; $out = strrev((string) preg_replace('/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev($num))); if($dollar && is_numeric($num)) { $out = "$" . $out; } return $out; } echo prettynum(123456)," "; echo prettynum(123456, 1)
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected end of file, expecting ',' or ';' in /in/D9gVl on line 12
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end, expecting ',' or ';' in /in/D9gVl on line 12
Process exited with code 255.

preferences:
174.89 ms | 1395 KiB | 67 Q