3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Lisbon'); $picagemnr=$_REQUEST['turno']; $msg=$_REQUEST['msg']; $idmsg = $_REQUEST['idmsg']; $action=$_REQUEST['action']; $userid = $_REQUEST['userid']; $insert = $_REQUEST['insert']; $refeicao=$_REQUEST['refeicao']; SESSION_START(); include "db_connect.php"; $year = date("Y"); $month = date("m"); $day = date("d"); $hour = date("H"); $minute = date("i"); $seconds = date("s"); $ip = $_SERVER['REMOTE_ADDR']; $time = time(); $datacompleta = date("Y-m-d"); $horacompleta = date("H:i:s"); //upload foto $file_path = "uploads/"; $file_path = $file_path . basename( $_FILES['uploaded_file']['name']); // *** Include the class include("resize-class.php"); // *** 1) Initialise / load image $resizeObj = new resize('uploads/image.jpg'); // *** 2) Resize image (options: exact, portrait, landscape, auto, crop) $resizeObj -> resizeImage(300, 220, 'auto'); // *** 3) Save image $resizeObj -> saveImage('uploads/sample-resized.jpg', 100); $img_src = "uploads/sample-resized.jpg"; $imgbinary = fread(fopen($img_src, "r"), filesize($img_src)); $img_str = base64_encode($imgbinary); $im='data:image/jpg;base64,'.$img_str.''; //end foto switch ($refeicao){ case almoco: $almoco='1'; break; case jantar: $jantar='1'; break; default: $refeicao=''; break; } // Dias Horas turno_manha turno_tarde total_dia switch ($picagemnr){ case '1': $picagemnr = '1.1'; $picagem = '1º Turno decisão almoço dia seguinte'; $turno_manha = '1'; $turno_tarde = '0'; break; case '2': $picagemnr = '1.2'; $picagem = 'Saída 1º turno'; $turno_manha = '1'; $turno_tarde = '0'; break; case '3': $picagemnr = '2.1'; $picagem = 'Segundo turno Entrada decisão Jantar dia seguinte'; $turno_tarde = '1'; $turno_manha = '0'; break; case '4': $picagemnr = '2.2'; $picagem = '2º turno Saída'; $turno_tarde = '1'; $turno_manha = '0'; break; } /*ver conteudo das vars. echo $userid; echo '<br />'; echo $picagemnr;echo '<br />'; echo $year;echo '<br />'; echo $month;echo '<br />'; echo $day;echo '<br />'; echo $hour;echo '<br />'; echo $minute;echo '<br />'; echo $seconds;echo '<br />'; echo $time;echo '<br />'; echo $ip;echo '<br />'; echo '<br />almoco';echo $almoco;echo '<br />jantar'; echo $jantar;echo '<br />'; echo $Dias;echo '<br />'; echo $Horas;echo '<br />'; echo $picagem;echo '<br />'; echo $turno_manha;echo '<br />'; echo $turno_tarde;echo '<br />'; echo $total_dia;echo '<br />'; echo $im;*/ If ($action == 'picagem'){ mysql_query("INSERT INTO `picagens`(`userid`, `picagemnr`, `ano`, `mes`, `dia`, `hora`, `minuto`, `segundo`, `time`, `ip`, `almoco`, `jantar`, `Dias`, `Horas`, `Picagem`, `turno_manha`, `turno_tarde`, `total_dia`, `foto_code`) VALUES ('$userid','$picagemnr','$year','$month','$day','$hour','$minute','$seconds','$time','$ip', '$almoco','$jantar','$Dias','$Horas','$picagem','$turno_manha','$turno_tarde', '$total_dia','$im')"); if ($msg == '1'){ mysql_query("UPDATE `mensagens` SET `data_lida` = '$datacompleta' ,`hora_lida`= '$horacompleta' WHERE `id` = '$idmsg'"); } }
Output for 8.0.0 - 8.0.12
Warning: Undefined array key "turno" in /in/Ogq2H on line 3 Warning: Undefined array key "msg" in /in/Ogq2H on line 4 Warning: Undefined array key "idmsg" in /in/Ogq2H on line 5 Warning: Undefined array key "action" in /in/Ogq2H on line 6 Warning: Undefined array key "userid" in /in/Ogq2H on line 7 Warning: Undefined array key "insert" in /in/Ogq2H on line 8 Warning: Undefined array key "refeicao" in /in/Ogq2H on line 9 Warning: session_start(): Session cannot be started after headers have already been sent in /in/Ogq2H on line 11 Warning: include(db_connect.php): Failed to open stream: No such file or directory in /in/Ogq2H on line 12 Warning: include(): Failed opening 'db_connect.php' for inclusion (include_path='.:') in /in/Ogq2H on line 12 Warning: Undefined array key "REMOTE_ADDR" in /in/Ogq2H on line 19 Warning: Undefined array key "uploaded_file" in /in/Ogq2H on line 28 Warning: Trying to access array offset on value of type null in /in/Ogq2H on line 28 Warning: include(resize-class.php): Failed to open stream: No such file or directory in /in/Ogq2H on line 31 Warning: include(): Failed opening 'resize-class.php' for inclusion (include_path='.:') in /in/Ogq2H on line 31 Fatal error: Uncaught Error: Class "resize" not found in /in/Ogq2H:34 Stack trace: #0 {main} thrown in /in/Ogq2H on line 34
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25
Warning: include(db_connect.php): failed to open stream: No such file or directory in /in/Ogq2H on line 12 Warning: include(): Failed opening 'db_connect.php' for inclusion (include_path='.:') in /in/Ogq2H on line 12 Warning: include(resize-class.php): failed to open stream: No such file or directory in /in/Ogq2H on line 31 Warning: include(): Failed opening 'resize-class.php' for inclusion (include_path='.:') in /in/Ogq2H on line 31 Fatal error: Uncaught Error: Class 'resize' not found in /in/Ogq2H:34 Stack trace: #0 {main} thrown in /in/Ogq2H on line 34
Process exited with code 255.
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Warning: include(db_connect.php): failed to open stream: No such file or directory in /in/Ogq2H on line 12 Warning: include(): Failed opening 'db_connect.php' for inclusion (include_path='.:') in /in/Ogq2H on line 12 Warning: include(resize-class.php): failed to open stream: No such file or directory in /in/Ogq2H on line 31 Warning: include(): Failed opening 'resize-class.php' for inclusion (include_path='.:') in /in/Ogq2H on line 31 Fatal error: Class 'resize' not found in /in/Ogq2H on line 34
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/Ogq2H</b> on line <b>11</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/Ogq2H:11) in <b>/in/Ogq2H</b> on line <b>11</b><br /> <br /> <b>Warning</b>: include(db_connect.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/in/Ogq2H</b> on line <b>12</b><br /> <br /> <b>Warning</b>: include() [<a href='function.include'>function.include</a>]: Failed opening 'db_connect.php' for inclusion (include_path='.:') in <b>/in/Ogq2H</b> on line <b>12</b><br /> <br /> <b>Warning</b>: include(resize-class.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/in/Ogq2H</b> on line <b>31</b><br /> <br /> <b>Warning</b>: include() [<a href='function.include'>function.include</a>]: Failed opening 'resize-class.php' for inclusion (include_path='.:') in <b>/in/Ogq2H</b> on line <b>31</b><br /> <br /> <b>Fatal error</b>: Class 'resize' not found in <b>/in/Ogq2H</b> on line <b>34</b><br />
Process exited with code 255.
Output for 5.0.0 - 5.0.5
<br /> <b>Fatal error</b>: Call to undefined function date_default_timezone_set() in <b>/in/Ogq2H</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.4.5 - 4.4.9
<br /> <b>Fatal error</b>: Call to undefined function: date_default_timezone_set() in <b>/in/Ogq2H</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
<br /> <b>Fatal error</b>: Call to undefined function: date_default_timezone_set() in <b>/in/Ogq2H</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: date_default_timezone_set() in <b>/in/Ogq2H</b> on line <b>2</b><br />

preferences:
259.18 ms | 401 KiB | 386 Q