3v4l.org

run code in 300+ PHP versions simultaneously
<?php include "conexion.php"; $fecha = date('Y-m-j'); $ayer = strtotime ( '-1 day' , strtotime ( $fecha ) ) ; $ayer = date ( 'Y-m-j' , $ayer ); $hacedias = strtotime ( '-8 day' , strtotime ( $fecha ) ) ; $hacedias = date ( 'Y-m-j' , $hacedias ); $consulta = "SELECT date_format(fecha,'%d %M') AS FECHA, round((SUM(`TotalMinutos`)/60),1) FROM reporte WHERE ingeniero ='". $_SESSION['id']."' AND fecha BETWEEN '$hacedias' AND '$ayer' GROUP BY fecha"; $rs = mysql_query($consulta,$conexion); if(mysql_num_rows($rs)!=0) { ?> <p></p> <p></p> <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100"> <tr> <?PHP $i = 0; while ($reg=mysql_fetch_array($rs)){ if($i == 8){ echo "</tr><tr>"; $i = 0; } else {} ?> <td width="100"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="150"> <tr> <td width="80"><B><?=$reg['FECHA']?></B></td> </tr> <tr> <td width="80"><?=$reg['round((SUM(`TotalMinutos`)/60),1)']?> Horas</td> </tr> </table> </td> <? $i++; } ?> </tr> </table> <p> <?PHP } else { echo "<h3><p style='color:#FF0000'> ATENCION!!! <br> No has registrado tus tiempos en los ultimos 5 dias.</p></h3>"; } ?> </table>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Parse error: syntax error, unexpected token "else" in /in/HnCEr on line 47
Process exited with code 255.
Output for 8.0.13
Warning: include(conexion.php): Failed to open stream: No such file or directory in /in/HnCEr on line 1 Warning: include(): Failed opening 'conexion.php' for inclusion (include_path='.:') in /in/HnCEr on line 1 Warning: Undefined variable $_SESSION in /in/HnCEr on line 9 Warning: Trying to access array offset on value of type null in /in/HnCEr on line 9 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/HnCEr:10 Stack trace: #0 {main} thrown in /in/HnCEr on line 10
Process exited with code 255.
Output for 7.4.33
Warning: include(conexion.php): failed to open stream: No such file or directory in /in/HnCEr on line 1 Warning: include(): Failed opening 'conexion.php' for inclusion (include_path='.:') in /in/HnCEr on line 1 Notice: Undefined variable: _SESSION in /in/HnCEr on line 9 Notice: Trying to access array offset on value of type null in /in/HnCEr on line 9 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/HnCEr:10 Stack trace: #0 {main} thrown in /in/HnCEr on line 10
Process exited with code 255.
Output for 7.2.29 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.32
Parse error: syntax error, unexpected 'else' (T_ELSE) in /in/HnCEr on line 47
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Warning: include(conexion.php): failed to open stream: No such file or directory in /in/HnCEr on line 1 Warning: include(): Failed opening 'conexion.php' for inclusion (include_path='.:') in /in/HnCEr on line 1 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/HnCEr:10 Stack trace: #0 {main} thrown in /in/HnCEr on line 10
Process exited with code 255.
Output for 7.1.20, 7.2.6
Warning: include(): open_basedir restriction in effect. File(conexion.php) is not within the allowed path(s): (/tmp:/in) in /in/HnCEr on line 1 Warning: include(conexion.php): failed to open stream: Operation not permitted in /in/HnCEr on line 1 Warning: include(): Failed opening 'conexion.php' for inclusion (include_path='.:') in /in/HnCEr on line 1 Notice: Undefined variable: _SESSION in /in/HnCEr on line 9 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/HnCEr:10 Stack trace: #0 {main} thrown in /in/HnCEr on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0
Warning: include(conexion.php): failed to open stream: No such file or directory in /in/HnCEr on line 1 Warning: include(): Failed opening 'conexion.php' for inclusion (include_path='.:') in /in/HnCEr on line 1 Notice: Undefined variable: _SESSION in /in/HnCEr on line 9 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/HnCEr:10 Stack trace: #0 {main} thrown in /in/HnCEr on line 10
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Warning: include(conexion.php): failed to open stream: No such file or directory in /in/HnCEr on line 1 Warning: include(): Failed opening 'conexion.php' for inclusion (include_path='.:') in /in/HnCEr on line 1 Notice: Undefined variable: _SESSION in /in/HnCEr on line 9 Fatal error: Call to undefined function mysql_query() in /in/HnCEr on line 10
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected T_ELSE in /in/HnCEr on line 47
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ELSE in /in/HnCEr on line 47
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/HnCEr on line 47
Process exited with code 255.

preferences:
266.21 ms | 401 KiB | 356 Q