3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 'On'); include 'storedinfo.php'; $server = "oniddb.cws.oregonstate.edu"; $username = "mcaliste-db"; $database = "mcaliste-db"; $mysqli = new mysqli($server, $username, $password, $database); if (!$mysqli || $mysqli->connect_errno) { echo "Connection error " .$mysqli->connect_errno ." ".$mysqli->connect_error; } else { echo "Connection successful<br>"; } // table name and attributes: // CREATE TABLE userinfo (id INT NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, // gender VARCHAR(6) NOT NULL, age INT NOT NULL, PRIMARY KEY (id) ); if(!empty($_POST)){ $name = htmlspecialchars($_POST['name']); $gender = htmlspecialchars($_POST['sex']); $age = htmlspecialchars($_POST['age']); } //$name = 'Bob'; //$gender = 'male'; //$age = 45; if (!($stmt = $mysqli->prepare("INSERT INTO userinfo(name, gender, age) VALUES (?, ?, ?)"))) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } $stmt->bind_param("ssi", $name, $gender, $age); $stmt->execute(); $stmt->close(); // remember to $stmt->close(); //$stmt->bind_result($resultName, $resultGender, $resultAge) //Select queries return a result set //if ($result = $mysqli->query("SELECT age FROM userinfo LIMIT 10")) { //printf("Select returned %d rows.\n", $result->num_rows); //free result set //$result->close(); //} ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 27
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 49
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 61
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 61
Branch analysis from position: 49
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 49
Branch analysis from position: 31
Branch analysis from position: 49
Branch analysis from position: 19
filename:       /in/X4PEr
function name:  (null)
number of ops:  72
compiled vars:  !0 = $server, !1 = $username, !2 = $database, !3 = $mysqli, !4 = $password, !5 = $name, !6 = $gender, !7 = $age, !8 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'ini_set'
          1        SEND_VAL                                                 'display_errors'
          2        SEND_VAL                                                 'On'
          3        DO_ICALL                                                 
    4     4        INCLUDE_OR_EVAL                                          'storedinfo.php', INCLUDE
    6     5        ASSIGN                                                   !0, 'oniddb.cws.oregonstate.edu'
    7     6        ASSIGN                                                   !1, 'mcaliste-db'
    8     7        ASSIGN                                                   !2, 'mcaliste-db'
   10     8        NEW                                              $14     'mysqli'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !4
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !3, $14
   11    15        BOOL_NOT                                         ~17     !3
         16      > JMPNZ_EX                                         ~17     ~17, ->19
         17    >   FETCH_OBJ_R                                      ~18     !3, 'connect_errno'
         18        BOOL                                             ~17     ~18
         19    > > JMPZ                                                     ~17, ->27
   12    20    >   FETCH_OBJ_R                                      ~19     !3, 'connect_errno'
         21        CONCAT                                           ~20     'Connection+error+', ~19
         22        CONCAT                                           ~21     ~20, '+'
         23        FETCH_OBJ_R                                      ~22     !3, 'connect_error'
         24        CONCAT                                           ~23     ~21, ~22
         25        ECHO                                                     ~23
         26      > JMP                                                      ->28
   14    27    >   ECHO                                                     'Connection+successful%3Cbr%3E'
   23    28    >   ISSET_ISEMPTY_VAR                             3  ~24     '_POST'
         29        BOOL_NOT                                         ~25     ~24
         30      > JMPZ                                                     ~25, ->49
   24    31    >   INIT_FCALL                                               'htmlspecialchars'
         32        FETCH_R                      global              ~26     '_POST'
         33        FETCH_DIM_R                                      ~27     ~26, 'name'
         34        SEND_VAL                                                 ~27
         35        DO_ICALL                                         $28     
         36        ASSIGN                                                   !5, $28
   25    37        INIT_FCALL                                               'htmlspecialchars'
         38        FETCH_R                      global              ~30     '_POST'
         39        FETCH_DIM_R                                      ~31     ~30, 'sex'
         40        SEND_VAL                                                 ~31
         41        DO_ICALL                                         $32     
         42        ASSIGN                                                   !6, $32
   26    43        INIT_FCALL                                               'htmlspecialchars'
         44        FETCH_R                      global              ~34     '_POST'
         45        FETCH_DIM_R                                      ~35     ~34, 'age'
         46        SEND_VAL                                                 ~35
         47        DO_ICALL                                         $36     
         48        ASSIGN                                                   !7, $36
   31    49    >   INIT_METHOD_CALL                                         !3, 'prepare'
         50        SEND_VAL_EX                                              'INSERT+INTO+userinfo%28name%2C+gender%2C+age%29+VALUES+%28%3F%2C+%3F%2C+%3F%29'
         51        DO_FCALL                                      0  $38     
         52        ASSIGN                                           ~39     !8, $38
         53        BOOL_NOT                                         ~40     ~39
         54      > JMPZ                                                     ~40, ->61
   32    55    >   FETCH_OBJ_R                                      ~41     !3, 'errno'
         56        CONCAT                                           ~42     'Prepare+failed%3A+%28', ~41
         57        CONCAT                                           ~43     ~42, '%29+'
         58        FETCH_OBJ_R                                      ~44     !3, 'error'
         59        CONCAT                                           ~45     ~43, ~44
         60        ECHO                                                     ~45
   34    61    >   INIT_METHOD_CALL                                         !8, 'bind_param'
         62        SEND_VAL_EX                                              'ssi'
         63        SEND_VAR_EX                                              !5
         64        SEND_VAR_EX                                              !6
         65        SEND_VAR_EX                                              !7
         66        DO_FCALL                                      0          
   36    67        INIT_METHOD_CALL                                         !8, 'execute'
         68        DO_FCALL                                      0          
   37    69        INIT_METHOD_CALL                                         !8, 'close'
         70        DO_FCALL                                      0          
   69    71      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.92 ms | 1405 KiB | 17 Q