3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (isset($_POST['submit']) && isset($_POST['titel']) && isset($_POST['trainer']) && isset($_POST['ort'])&& isset($_POST['dauer']) && $_POST['titel'] != '' && $_POST['trainer'] != '' && $_POST['ort'] != '' && (int)$_POST['dauer'] > 0) { try { $db = new MySQLi('localhost', 'root', '', 'php'); echo 'Verbindung offen.<br />'; $sql = 'INSERT INTO trainings (titel, trainer, ort, dauer) VALUES (?, ?, ?, ?)'; $kommando = $db->prepare($sql); $kommando->bind_param('sssi', $_POST['titel'], $_POST['trainer'], $_POST['ort'], $dauer); $dauer = (int)$_POST['dauer']; $kommando->execute(); echo 'SQL geschickt. <br />'; echo $kommando->affected_rows . ' Zeilen betroffen. <br />'; $db->close(); echo 'Verbindung zu.<br />'; } catch (Exception $e) { echo 'Fehler: ' . htmlspecialchars($e->getMessage()); } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 91
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 91
Branch analysis from position: 91
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 91
Branch analysis from position: 39
Branch analysis from position: 33
Branch analysis from position: 28
Branch analysis from position: 23
Branch analysis from position: 18
Branch analysis from position: 14
Branch analysis from position: 10
Branch analysis from position: 6
Found catch point at position: 83
Branch analysis from position: 83
2 jumps found. (Code = 107) Position 1 = 84, Position 2 = -2
Branch analysis from position: 84
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YiCUn
function name:  (null)
number of ops:  92
compiled vars:  !0 = $db, !1 = $sql, !2 = $kommando, !3 = $dauer, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_IS                                         ~5      '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      ~5, 'submit'
          2      > JMPZ_EX                                          ~6      ~6, ->6
          3    >   FETCH_IS                                         ~7      '_POST'
          4        ISSET_ISEMPTY_DIM_OBJ                         0  ~8      ~7, 'titel'
          5        BOOL                                             ~6      ~8
          6    > > JMPZ_EX                                          ~6      ~6, ->10
          7    >   FETCH_IS                                         ~9      '_POST'
          8        ISSET_ISEMPTY_DIM_OBJ                         0  ~10     ~9, 'trainer'
          9        BOOL                                             ~6      ~10
         10    > > JMPZ_EX                                          ~6      ~6, ->14
         11    >   FETCH_IS                                         ~11     '_POST'
         12        ISSET_ISEMPTY_DIM_OBJ                         0  ~12     ~11, 'ort'
         13        BOOL                                             ~6      ~12
         14    > > JMPZ_EX                                          ~6      ~6, ->18
    3    15    >   FETCH_IS                                         ~13     '_POST'
         16        ISSET_ISEMPTY_DIM_OBJ                         0  ~14     ~13, 'dauer'
         17        BOOL                                             ~6      ~14
         18    > > JMPZ_EX                                          ~6      ~6, ->23
         19    >   FETCH_R                      global              ~15     '_POST'
         20        FETCH_DIM_R                                      ~16     ~15, 'titel'
         21        IS_NOT_EQUAL                                     ~17     ~16, ''
         22        BOOL                                             ~6      ~17
         23    > > JMPZ_EX                                          ~6      ~6, ->28
         24    >   FETCH_R                      global              ~18     '_POST'
         25        FETCH_DIM_R                                      ~19     ~18, 'trainer'
         26        IS_NOT_EQUAL                                     ~20     ~19, ''
         27        BOOL                                             ~6      ~20
         28    > > JMPZ_EX                                          ~6      ~6, ->33
         29    >   FETCH_R                      global              ~21     '_POST'
         30        FETCH_DIM_R                                      ~22     ~21, 'ort'
         31        IS_NOT_EQUAL                                     ~23     ~22, ''
         32        BOOL                                             ~6      ~23
         33    > > JMPZ_EX                                          ~6      ~6, ->39
    4    34    >   FETCH_R                      global              ~24     '_POST'
         35        FETCH_DIM_R                                      ~25     ~24, 'dauer'
         36        CAST                                          4  ~26     ~25
         37        IS_SMALLER                                       ~27     0, ~26
         38        BOOL                                             ~6      ~27
         39    > > JMPZ                                                     ~6, ->91
    6    40    >   NEW                                              $28     'MySQLi'
         41        SEND_VAL_EX                                              'localhost'
         42        SEND_VAL_EX                                              'root'
         43        SEND_VAL_EX                                              ''
         44        SEND_VAL_EX                                              'php'
         45        DO_FCALL                                      0          
         46        ASSIGN                                                   !0, $28
    7    47        ECHO                                                     'Verbindung+offen.%3Cbr+%2F%3E'
    8    48        ASSIGN                                                   !1, 'INSERT+INTO+trainings+%28titel%2C+trainer%2C+ort%2C+dauer%29+VALUES+%28%3F%2C+%3F%2C+%3F%2C+%3F%29'
    9    49        INIT_METHOD_CALL                                         !0, 'prepare'
         50        SEND_VAR_EX                                              !1
         51        DO_FCALL                                      0  $32     
         52        ASSIGN                                                   !2, $32
   10    53        INIT_METHOD_CALL                                         !2, 'bind_param'
         54        SEND_VAL_EX                                              'sssi'
         55        CHECK_FUNC_ARG                                           
         56        FETCH_FUNC_ARG               global              $34     '_POST'
         57        FETCH_DIM_FUNC_ARG                               $35     $34, 'titel'
         58        SEND_FUNC_ARG                                            $35
         59        CHECK_FUNC_ARG                                           
         60        FETCH_FUNC_ARG               global              $36     '_POST'
         61        FETCH_DIM_FUNC_ARG                               $37     $36, 'trainer'
         62        SEND_FUNC_ARG                                            $37
         63        CHECK_FUNC_ARG                                           
         64        FETCH_FUNC_ARG               global              $38     '_POST'
         65        FETCH_DIM_FUNC_ARG                               $39     $38, 'ort'
         66        SEND_FUNC_ARG                                            $39
         67        SEND_VAR_EX                                              !3
         68        DO_FCALL                                      0          
   11    69        FETCH_R                      global              ~41     '_POST'
         70        FETCH_DIM_R                                      ~42     ~41, 'dauer'
         71        CAST                                          4  ~43     ~42
         72        ASSIGN                                                   !3, ~43
   12    73        INIT_METHOD_CALL                                         !2, 'execute'
         74        DO_FCALL                                      0          
   13    75        ECHO                                                     'SQL+geschickt.+%3Cbr+%2F%3E'
   14    76        FETCH_OBJ_R                                      ~46     !2, 'affected_rows'
         77        CONCAT                                           ~47     ~46, '+Zeilen+betroffen.+%3Cbr+%2F%3E'
         78        ECHO                                                     ~47
   15    79        INIT_METHOD_CALL                                         !0, 'close'
         80        DO_FCALL                                      0          
   16    81        ECHO                                                     'Verbindung+zu.%3Cbr+%2F%3E'
         82      > JMP                                                      ->91
   17    83  E > > CATCH                                       last         'Exception'
   18    84    >   INIT_FCALL                                               'htmlspecialchars'
         85        INIT_METHOD_CALL                                         !4, 'getMessage'
         86        DO_FCALL                                      0  $49     
         87        SEND_VAR                                                 $49
         88        DO_ICALL                                         $50     
         89        CONCAT                                           ~51     'Fehler%3A+', $50
         90        ECHO                                                     ~51
   21    91    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.15 ms | 1404 KiB | 15 Q