3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create connection $start = microtime(TRUE); error_log('Connecting'); $connection=mysqli_connect("localhost","******","*****","*****"); error_log('Connection took' . microtime(TRUE) - $start); // Check connection if ($connection == false) { die("ERROR: Could not connect. " .mysqli_connect_error()); } // This SQL statement selects ALL from the table 'Locations' $sql = "SELECT * FROM Notes"; error_log('Running select'); if ($result = mysqli_query($connection, $sql)){ error_log('Select took' . microtime(TRUE) - $start); // If so, then create a results array and a temporary one // to hold the data $resultArray = array(); // Loop through each row in the result set error_log('looping fetch'); while($row = $result->fetch_object()) { error_log('Fetch is running at ' . microtime(TRUE) - $start); // Add each row into our results array $resultArray[] = $row; } // Finally, encode the array to JSON and output the results echo json_encode($resultArray); } error_log('Fetch is done at ' . microtime(TRUE) - $start); // Close connections mysqli_close($connection); error_log('Connection closed at ' . microtime(TRUE) - $start); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 28
Branch analysis from position: 24
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 69
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 51
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 51
Branch analysis from position: 65
Branch analysis from position: 51
Branch analysis from position: 69
filename:       /in/5Jr3N
function name:  (null)
number of ops:  89
compiled vars:  !0 = $start, !1 = $connection, !2 = $sql, !3 = $result, !4 = $resultArray, !5 = $row
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $6      
          3        ASSIGN                                                   !0, $6
    4     4        INIT_FCALL                                               'error_log'
          5        SEND_VAL                                                 'Connecting'
          6        DO_ICALL                                                 
    5     7        INIT_FCALL_BY_NAME                                       'mysqli_connect'
          8        SEND_VAL_EX                                              'localhost'
          9        SEND_VAL_EX                                              '%2A%2A%2A%2A%2A%2A'
         10        SEND_VAL_EX                                              '%2A%2A%2A%2A%2A'
         11        SEND_VAL_EX                                              '%2A%2A%2A%2A%2A'
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !1, $9
    6    14        INIT_FCALL                                               'error_log'
         15        INIT_FCALL                                               'microtime'
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $11     
         18        SUB                                              ~12     $11, !0
         19        CONCAT                                           ~13     'Connection+took', ~12
         20        SEND_VAL                                                 ~13
         21        DO_ICALL                                                 
    8    22        BOOL_NOT                                         ~15     !1
         23      > JMPZ                                                     ~15, ->28
    9    24    >   INIT_FCALL_BY_NAME                                       'mysqli_connect_error'
         25        DO_FCALL                                      0  $16     
         26        CONCAT                                           ~17     'ERROR%3A+Could+not+connect.+', $16
         27      > EXIT                                                     ~17
   12    28    >   ASSIGN                                                   !2, 'SELECT+%2A+FROM+Notes'
   13    29        INIT_FCALL                                               'error_log'
         30        SEND_VAL                                                 'Running+select'
         31        DO_ICALL                                                 
   14    32        INIT_FCALL_BY_NAME                                       'mysqli_query'
         33        SEND_VAR_EX                                              !1
         34        SEND_VAR_EX                                              !2
         35        DO_FCALL                                      0  $20     
         36        ASSIGN                                           ~21     !3, $20
         37      > JMPZ                                                     ~21, ->69
   15    38    >   INIT_FCALL                                               'error_log'
         39        INIT_FCALL                                               'microtime'
         40        SEND_VAL                                                 <true>
         41        DO_ICALL                                         $22     
         42        SUB                                              ~23     $22, !0
         43        CONCAT                                           ~24     'Select+took', ~23
         44        SEND_VAL                                                 ~24
         45        DO_ICALL                                                 
   18    46        ASSIGN                                                   !4, <array>
   20    47        INIT_FCALL                                               'error_log'
         48        SEND_VAL                                                 'looping+fetch'
         49        DO_ICALL                                                 
   21    50      > JMP                                                      ->61
   23    51    >   INIT_FCALL                                               'error_log'
         52        INIT_FCALL                                               'microtime'
         53        SEND_VAL                                                 <true>
         54        DO_ICALL                                         $28     
         55        SUB                                              ~29     $28, !0
         56        CONCAT                                           ~30     'Fetch+is+running+at+', ~29
         57        SEND_VAL                                                 ~30
         58        DO_ICALL                                                 
   25    59        ASSIGN_DIM                                               !4
         60        OP_DATA                                                  !5
   21    61    >   INIT_METHOD_CALL                                         !3, 'fetch_object'
         62        DO_FCALL                                      0  $33     
         63        ASSIGN                                           ~34     !5, $33
         64      > JMPNZ                                                    ~34, ->51
   28    65    >   INIT_FCALL                                               'json_encode'
         66        SEND_VAR                                                 !4
         67        DO_ICALL                                         $35     
         68        ECHO                                                     $35
   30    69    >   INIT_FCALL                                               'error_log'
         70        INIT_FCALL                                               'microtime'
         71        SEND_VAL                                                 <true>
         72        DO_ICALL                                         $36     
         73        SUB                                              ~37     $36, !0
         74        CONCAT                                           ~38     'Fetch+is+done+at+', ~37
         75        SEND_VAL                                                 ~38
         76        DO_ICALL                                                 
   32    77        INIT_FCALL_BY_NAME                                       'mysqli_close'
         78        SEND_VAR_EX                                              !1
         79        DO_FCALL                                      0          
   33    80        INIT_FCALL                                               'error_log'
         81        INIT_FCALL                                               'microtime'
         82        SEND_VAL                                                 <true>
         83        DO_ICALL                                         $41     
         84        SUB                                              ~42     $41, !0
         85        CONCAT                                           ~43     'Connection+closed+at+', ~42
         86        SEND_VAL                                                 ~43
         87        DO_ICALL                                                 
   34    88      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.85 ms | 1016 KiB | 16 Q