3v4l.org

run code in 500+ 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 = 20
Branch analysis from position: 12
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 49
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 47
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 49
filename:       /in/YOBGX
function name:  (null)
number of ops:  52
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, ->20
    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      > INIT_FCALL                                                   'exit'
         19*       DO_ICALL                                                     
   11    20    >   ASSIGN                                                       !1, 'Amersfoort'
   14    21        INIT_METHOD_CALL                                             !0, 'prepare'
         22        SEND_VAL_EX                                                  'SELECT+%2A+FROM+%60users%60+WHERE+username%3D%3F+AND+password%3D%3F'
         23        DO_FCALL                                          0  $15     
         24        ASSIGN                                               ~16     !2, $15
         25      > JMPZ                                                         ~16, ->49
   17    26    >   INIT_METHOD_CALL                                             !2, 'bind_param'
         27        SEND_VAL_EX                                                  'ss'
         28        SEND_VAR_EX                                                  !3
         29        SEND_VAR_EX                                                  !4
         30        DO_FCALL                                          0          
   20    31        INIT_METHOD_CALL                                             !2, 'execute'
         32        DO_FCALL                                          0          
   23    33        INIT_METHOD_CALL                                             !2, 'bind_result'
         34        SEND_VAR_EX                                                  !5
         35        DO_FCALL                                          0          
   26    36        INIT_METHOD_CALL                                             !2, 'fetch'
         37        DO_FCALL                                          0          
   28    38        COUNT                                                ~21     !5
         39        IS_SMALLER                                                   0, ~21
         40      > JMPZ                                                         ~22, ->47
   30    41    >   FETCH_W                          global              $23     '_SESSION'
         42        ASSIGN_DIM                                                   $23, 'authentificated'
         43        OP_DATA                                                      <true>
   31    44        FETCH_W                          global              $25     '_SESSION'
         45        ASSIGN_DIM                                                   $25, 'username'
         46        OP_DATA                                                      !3
   36    47    >   INIT_METHOD_CALL                                             !2, 'close'
         48        DO_FCALL                                          0          
   40    49    >   INIT_METHOD_CALL                                             !0, 'close'
         50        DO_FCALL                                          0          
   41    51      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
174.64 ms | 2094 KiB | 16 Q