3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 7.0.0 - 7.1.0
Notice: Undefined index: turno in /in/Ogq2H on line 3 Notice: Undefined index: msg in /in/Ogq2H on line 4 Notice: Undefined index: idmsg in /in/Ogq2H on line 5 Notice: Undefined index: action in /in/Ogq2H on line 6 Notice: Undefined index: userid in /in/Ogq2H on line 7 Notice: Undefined index: insert in /in/Ogq2H on line 8 Notice: Undefined index: refeicao in /in/Ogq2H on line 9 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/Ogq2H:3) in /in/Ogq2H on line 11 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/Ogq2H:3) 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 Notice: Undefined index: REMOTE_ADDR in /in/Ogq2H on line 19 Notice: Undefined index: uploaded_file 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 5.3.0 - 5.6.28
Notice: Undefined index: turno in /in/Ogq2H on line 3 Notice: Undefined index: msg in /in/Ogq2H on line 4 Notice: Undefined index: idmsg in /in/Ogq2H on line 5 Notice: Undefined index: action in /in/Ogq2H on line 6 Notice: Undefined index: userid in /in/Ogq2H on line 7 Notice: Undefined index: insert in /in/Ogq2H on line 8 Notice: Undefined index: refeicao in /in/Ogq2H on line 9 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/Ogq2H:3) in /in/Ogq2H on line 11 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/Ogq2H:3) 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 Notice: Undefined index: REMOTE_ADDR in /in/Ogq2H on line 19 Notice: Undefined index: uploaded_file 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: Class 'resize' not found in /in/Ogq2H on line 34
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Notice: Undefined index: turno in /in/Ogq2H on line 3 Notice: Undefined index: msg in /in/Ogq2H on line 4 Notice: Undefined index: idmsg in /in/Ogq2H on line 5 Notice: Undefined index: action in /in/Ogq2H on line 6 Notice: Undefined index: userid in /in/Ogq2H on line 7 Notice: Undefined index: insert in /in/Ogq2H on line 8 Notice: Undefined index: refeicao in /in/Ogq2H on line 9 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/Ogq2H:3) in /in/Ogq2H on line 11 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/Ogq2H:3) 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 Notice: Undefined index: REMOTE_ADDR in /in/Ogq2H on line 19 Notice: Undefined index: uploaded_file 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: Class 'resize' not found in /in/Ogq2H on line 34
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/Ogq2H on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Ogq2H on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Ogq2H on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Ogq2H on line 2