3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php #incluide <stdio.h> int suma_nprimeros(int n); { int i, suma=0; for(i=1;1<=n;i++) suma +=i; return suma; } void main() { int n, suma; printf("introduzca n:"); scanf("%d",&n); if(n<0) printf("El numero es negativo. \n"); else { suma=suma_nprimeros(n); printf("La suma de los %d primeros numeros es: %d.\n",n,suma); } }
based on aUQJS9
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.6
Parse error: syntax error, unexpected 'suma_nprimeros' (T_STRING) in /in/K3f8r on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_STRING in /in/K3f8r:5 Stack trace: #0 {main}
Process exited with code 255.