3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Connect to Database $con=mysqli_connect("localhost", "root", "password", "user"); mysqli_query($con, "SET CHARACTER SET utf8"); if(isset($_POST['name'])) { $name = $_POST['name']; } else { } if(isset($_POST['age'])) { $age = $_POST['age']; } else { } //Grabs values from Database $stmt = mysqli_prepare($con, "SELECT * FROM user WHERE username = ? AND password = ?"); //Protects against SQL injection attacks mysqli_stmt_bind_param($stmt, "ss", $username, $password); //Execute mysqli_stmt_execute($stmt); //Bind results mysqli_stmt_bind_result($stmt, $userID, $name, $age, $username, $password); //Holds data of user returned $user = array(); //Stores returned data in the array while(mysqli_stmt_fetch($stmt)){ $user[name] = $name; $user[age] = $age; $user[username] = $username; $user[password] = $password; } //Turns array into a json echo json_encode($user); //Close Statment mysqli_stmt_close($stmt); //Close Connection mysqli_close($con); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 49
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 49
Branch analysis from position: 65
Branch analysis from position: 49
Branch analysis from position: 25
Branch analysis from position: 18
filename:       /in/MEfjd
function name:  (null)
number of ops:  76
compiled vars:  !0 = $con, !1 = $name, !2 = $age, !3 = $stmt, !4 = $username, !5 = $password, !6 = $userID, !7 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'mysqli_connect'
          1        SEND_VAL_EX                                              'localhost'
          2        SEND_VAL_EX                                              'root'
          3        SEND_VAL_EX                                              'password'
          4        SEND_VAL_EX                                              'user'
          5        DO_FCALL                                      0  $8      
          6        ASSIGN                                                   !0, $8
    5     7        INIT_FCALL_BY_NAME                                       'mysqli_query'
          8        SEND_VAR_EX                                              !0
          9        SEND_VAL_EX                                              'SET+CHARACTER+SET+utf8'
         10        DO_FCALL                                      0          
    7    11        FETCH_IS                                         ~11     '_POST'
         12        ISSET_ISEMPTY_DIM_OBJ                         0          ~11, 'name'
         13      > JMPZ                                                     ~12, ->18
    8    14    >   FETCH_R                      global              ~13     '_POST'
         15        FETCH_DIM_R                                      ~14     ~13, 'name'
         16        ASSIGN                                                   !1, ~14
         17      > JMP                                                      ->18
   11    18    >   FETCH_IS                                         ~16     '_POST'
         19        ISSET_ISEMPTY_DIM_OBJ                         0          ~16, 'age'
         20      > JMPZ                                                     ~17, ->25
   12    21    >   FETCH_R                      global              ~18     '_POST'
         22        FETCH_DIM_R                                      ~19     ~18, 'age'
         23        ASSIGN                                                   !2, ~19
         24      > JMP                                                      ->25
   18    25    >   INIT_FCALL_BY_NAME                                       'mysqli_prepare'
         26        SEND_VAR_EX                                              !0
         27        SEND_VAL_EX                                              'SELECT+%2A+FROM+user+WHERE+username+%3D+%3F+AND+password+%3D+%3F'
         28        DO_FCALL                                      0  $21     
         29        ASSIGN                                                   !3, $21
   21    30        INIT_FCALL_BY_NAME                                       'mysqli_stmt_bind_param'
         31        SEND_VAR_EX                                              !3
         32        SEND_VAL_EX                                              'ss'
         33        SEND_VAR_EX                                              !4
         34        SEND_VAR_EX                                              !5
         35        DO_FCALL                                      0          
   24    36        INIT_FCALL_BY_NAME                                       'mysqli_stmt_execute'
         37        SEND_VAR_EX                                              !3
         38        DO_FCALL                                      0          
   28    39        INIT_FCALL_BY_NAME                                       'mysqli_stmt_bind_result'
         40        SEND_VAR_EX                                              !3
         41        SEND_VAR_EX                                              !6
         42        SEND_VAR_EX                                              !1
         43        SEND_VAR_EX                                              !2
         44        SEND_VAR_EX                                              !4
         45        SEND_VAR_EX                                              !5
         46        DO_FCALL                                      0          
   31    47        ASSIGN                                                   !7, <array>
   34    48      > JMP                                                      ->61
   35    49    >   FETCH_CONSTANT                                   ~27     'name'
         50        ASSIGN_DIM                                               !7, ~27
         51        OP_DATA                                                  !1
   36    52        FETCH_CONSTANT                                   ~29     'age'
         53        ASSIGN_DIM                                               !7, ~29
         54        OP_DATA                                                  !2
   37    55        FETCH_CONSTANT                                   ~31     'username'
         56        ASSIGN_DIM                                               !7, ~31
         57        OP_DATA                                                  !4
   38    58        FETCH_CONSTANT                                   ~33     'password'
         59        ASSIGN_DIM                                               !7, ~33
         60        OP_DATA                                                  !5
   34    61    >   INIT_FCALL_BY_NAME                                       'mysqli_stmt_fetch'
         62        SEND_VAR_EX                                              !3
         63        DO_FCALL                                      0  $35     
         64      > JMPNZ                                                    $35, ->49
   44    65    >   INIT_FCALL                                               'json_encode'
         66        SEND_VAR                                                 !7
         67        DO_ICALL                                         $36     
         68        ECHO                                                     $36
   49    69        INIT_FCALL_BY_NAME                                       'mysqli_stmt_close'
         70        SEND_VAR_EX                                              !3
         71        DO_FCALL                                      0          
   52    72        INIT_FCALL_BY_NAME                                       'mysqli_close'
         73        SEND_VAR_EX                                              !0
         74        DO_FCALL                                      0          
   53    75      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.97 ms | 1400 KiB | 15 Q