biowep
16-03-2013, 18:31
Ciao, non riesco in nessun modo a trovare l'errore qui dentro (ci ho perso mezz'ora) e sono arrivato alla conclusione che sia un bug di php. Possibile?
Per far sparire l'errore devo togliere if(DEBUG){}
L'errore sparisce anche nel caso in cui trasformo if(DEBUG){} con la sintassi alternativa
if(DEBUG): endif; Oppure nel caso in cui inverto le due condizioni nel ciclo
if($stack[$i] == Expression::$var):
elseif(get_class($stack[$i]) == 'Operator'):
endif;
for($i=0; $i<$length; ++$i):
if(get_class($stack[$i]) == 'Operator'):
//codice senza errori al 100%
if(DEBUG){
$tempStack = new Rpn($stack);
echo $tempStack->represent()."<br />\n";
}
elseif($stack[$i] == Expression::$var)://304
if($var) $stack[i] = $var;
else throw new Exception(M::VariableWithoutValue);
endif;
endfor;
Parse error: syntax error, unexpected ':' in C:\Program Files (x86)\EasyPHP-12.1\www\calculation.php on line 304
Per far sparire l'errore devo togliere if(DEBUG){}
L'errore sparisce anche nel caso in cui trasformo if(DEBUG){} con la sintassi alternativa
if(DEBUG): endif; Oppure nel caso in cui inverto le due condizioni nel ciclo
if($stack[$i] == Expression::$var):
elseif(get_class($stack[$i]) == 'Operator'):
endif;
for($i=0; $i<$length; ++$i):
if(get_class($stack[$i]) == 'Operator'):
//codice senza errori al 100%
if(DEBUG){
$tempStack = new Rpn($stack);
echo $tempStack->represent()."<br />\n";
}
elseif($stack[$i] == Expression::$var)://304
if($var) $stack[i] = $var;
else throw new Exception(M::VariableWithoutValue);
endif;
endfor;
Parse error: syntax error, unexpected ':' in C:\Program Files (x86)\EasyPHP-12.1\www\calculation.php on line 304