3v4l.org

run code in 300+ PHP versions simultaneously
<?php @session_start(); $_SESSION['externe_creer'] = $_POST; $edit_mode = false; if(is_numeric($_POST['ID']) && (int)$_POST['ID'] > 0) { $edit_mode = true; } try { $orig = NULL; // create formation object if($edit_mode) { $form = new DIVERSES($_POST['ID']); $orig = new DIVERSES($_POST['ID']); } else { $form = new DIVERSES(); } if(empty($_POST['autres_dest'])) { $_POST['autres_dest'] = NULL; } $form->usager_id = getUsagerIDFromCourriel($_POST['courriel']); $form->unite_administrative_id = $_POST['unite_administrative_id']; $form->titre_externe = $_POST['titre_externe']; $form->date_debut = $_POST['date_debut']; $form->date_fin = $_POST['date_fin']; $form->lieu = $_POST['lieu']; $form->projet_accepte = $_POST['projet_accepte']; $form->frais_pb = $_POST['frais_pb']; $form->note = $_POST['note']; $form->autres_dest = $_POST['autres_dest']; $form->motif_compte = $_POST['motif_compte']; $form->Save(); var_dump($orig === $form); // return to main page if($edit_mode) { //header('Location: index.php?m=gestion&p=formations_liste&result=1'); ?> <script type="text/javascript"> //document.location = 'index.php?m=gestion&p=diverses_liste&result=1'; </script> <?php } else { //header('Location: index.php?m=gestion&p=formations_creer&result=1'); ?> <script type="text/javascript"> //document.location = 'index.php?m=gestion&p=diverses_creer&result=1'; </script> <?php } } catch (Exception $e) { //print_r($e); // error occured, fuck! if($edit_mode) { //header('Location: index.php?m=gestion&p=formations_liste&result=0'); ?> <script type="text/javascript"> document.location = 'index.php?m=gestion&p=diverses_liste&result=0'; </script> <?php } else { //header('Location: index.php?m=gestion&p=formations_creer&result=0'); ?> <script type="text/javascript"> //document.location = 'index.php?m=gestion&p=externe_creer&result=0'; </script> <?php } } ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Warning: Undefined array key "ID" in /in/av7Ts on line 8 Fatal error: Uncaught Error: Class "DIVERSES" not found in /in/av7Ts:25 Stack trace: #0 {main} thrown in /in/av7Ts on line 25
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined index: ID in /in/av7Ts on line 8 Fatal error: Uncaught Error: Class 'DIVERSES' not found in /in/av7Ts:25 Stack trace: #0 {main} thrown in /in/av7Ts on line 25
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Fatal error: Uncaught Error: Class 'DIVERSES' not found in /in/av7Ts:25 Stack trace: #0 {main} thrown in /in/av7Ts on line 25
Process exited with code 255.
Output for 5.5.0 - 5.5.36, 5.6.0 - 5.6.28
Notice: Undefined index: ID in /in/av7Ts on line 8 Fatal error: Class 'DIVERSES' not found in /in/av7Ts on line 25
Process exited with code 255.

preferences:
174.58 ms | 402 KiB | 219 Q