3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getCoefAtAmericanFormat($coef) { if ($coef == '' || $coef == 0) { return 0; } return $coef == 2 ? "+100" : $coef < 2 ? '-' . round((100 / ($coef - 1)) : '+' . round((($coef - 1) * 100)); } echo getCoefAtAmericanFormat(1.04);
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.25
Parse error: syntax error, unexpected ':' in /in/rOOQI on line 10
Process exited with code 255.

preferences:
182.71 ms | 1395 KiB | 62 Q