3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); $mysqli = new mysqli("localhost", "my_user", "my_password", "world"); /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $city = "Amersfoort"; /* create a prepared statement */ if ($stmt = $mysqli->prepare("SELECT * FROM `users` WHERE username=? AND password=?")) { /* bind parameters for markers */ $stmt->bind_param("ss", $username,$password); /* execute query */ $stmt->execute(); /* bind result variables */ $stmt->bind_result($result); /* fetch value */ $stmt->fetch(); if( count($result) > 0 ){ $_SESSION['authentificated'] = true; $_SESSION['username'] = $username; } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 48
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 48
filename:       /in/YOBGX
function name:  (null)
number of ops:  51
compiled vars:  !0 = $mysqli, !1 = $city, !2 = $stmt, !3 = $username, !4 = $password, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    3     2        NEW                                              $7      'mysqli'
          3        SEND_VAL_EX                                              'localhost'
          4        SEND_VAL_EX                                              'my_user'
          5        SEND_VAL_EX                                              'my_password'
          6        SEND_VAL_EX                                              'world'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $7
    6     9        INIT_FCALL_BY_NAME                                       'mysqli_connect_errno'
         10        DO_FCALL                                      0  $10     
         11      > JMPZ                                                     $10, ->19
    7    12    >   INIT_FCALL                                               'printf'
         13        SEND_VAL                                                 'Connect+failed%3A+%25s%0A'
         14        INIT_FCALL_BY_NAME                                       'mysqli_connect_error'
         15        DO_FCALL                                      0  $11     
         16        SEND_VAR                                                 $11
         17        DO_ICALL                                                 
    8    18      > EXIT                                                     
   11    19    >   ASSIGN                                                   !1, 'Amersfoort'
   14    20        INIT_METHOD_CALL                                         !0, 'prepare'
         21        SEND_VAL_EX                                              'SELECT+%2A+FROM+%60users%60+WHERE+username%3D%3F+AND+password%3D%3F'
         22        DO_FCALL                                      0  $14     
         23        ASSIGN                                           ~15     !2, $14
         24      > JMPZ                                                     ~15, ->48
   17    25    >   INIT_METHOD_CALL                                         !2, 'bind_param'
         26        SEND_VAL_EX                                              'ss'
         27        SEND_VAR_EX                                              !3
         28        SEND_VAR_EX                                              !4
         29        DO_FCALL                                      0          
   20    30        INIT_METHOD_CALL                                         !2, 'execute'
         31        DO_FCALL                                      0          
   23    32        INIT_METHOD_CALL                                         !2, 'bind_result'
         33        SEND_VAR_EX                                              !5
         34        DO_FCALL                                      0          
   26    35        INIT_METHOD_CALL                                         !2, 'fetch'
         36        DO_FCALL                                      0          
   28    37        COUNT                                            ~20     !5
         38        IS_SMALLER                                               0, ~20
         39      > JMPZ                                                     ~21, ->46
   30    40    >   FETCH_W                      global              $22     '_SESSION'
         41        ASSIGN_DIM                                               $22, 'authentificated'
         42        OP_DATA                                                  <true>
   31    43        FETCH_W                      global              $24     '_SESSION'
         44        ASSIGN_DIM                                               $24, 'username'
         45        OP_DATA                                                  !3
   36    46    >   INIT_METHOD_CALL                                         !2, 'close'
         47        DO_FCALL                                      0          
   40    48    >   INIT_METHOD_CALL                                         !0, 'close'
         49        DO_FCALL                                      0          
   41    50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.09 ms | 1006 KiB | 15 Q