I am trying to compile the below code in zephir language and it gives me Parse error. I am not sure what am I doing wrong.
public static function calculateDiscrepancy(tpImpr, liImpressions, defaults) {
var numeratorx = 1-(tpImpr + defaults);
if numeratorx != 0 && liImpressions != 0 {
return (double)(numeratorx / liImpressions) * 100;
}else{
return 0;
}
}
Error:
Zephir\ParseException: Syntax error in /var/www/vhosts/app/advertisingcalculator.zep on line 58
var numeratorx = 1-(tpImpr + defaults);
-----------------------^
Any Ideas?