3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * Create a table with a LONGTEXT and pull in some data */ $mysqli = new mysqli("127.0.0.1", "root", "root", "test_hhvm"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } if (!$mysqli->query("DROP TABLE IF EXISTS test") || !$mysqli->query("CREATE TABLE test(label LONGTEXT)")) { echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error; } $mysqli->query('INSERT INTO test(label) values ("test")'); /* * Hit the bug, expect a segfault on hhvm */ $stmt = $mysqli->prepare("SELECT label FROM test"); $stmt->execute(); $stmt->bind_result($label); while($stmt->fetch()) { echo "$label" . PHP_EOL; } $stmt->close(); $mysqli->close(); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 47) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 32
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 45
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 45
Branch analysis from position: 51
Branch analysis from position: 45
Branch analysis from position: 32
Branch analysis from position: 25
Branch analysis from position: 15
filename:       /in/sZbYe
function name:  (null)
number of ops:  56
compiled vars:  !0 = $mysqli, !1 = $stmt, !2 = $label
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $3      'mysqli'
          1        SEND_VAL_EX                                              '127.0.0.1'
          2        SEND_VAL_EX                                              'root'
          3        SEND_VAL_EX                                              'root'
          4        SEND_VAL_EX                                              'test_hhvm'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
    8     7        FETCH_OBJ_R                                      ~6      !0, 'connect_errno'
          8      > JMPZ                                                     ~6, ->15
    9     9    >   FETCH_OBJ_R                                      ~7      !0, 'connect_errno'
         10        CONCAT                                           ~8      'Failed+to+connect+to+MySQL%3A+%28', ~7
         11        CONCAT                                           ~9      ~8, '%29+'
         12        FETCH_OBJ_R                                      ~10     !0, 'connect_error'
         13        CONCAT                                           ~11     ~9, ~10
         14        ECHO                                                     ~11
   12    15    >   INIT_METHOD_CALL                                         !0, 'query'
         16        SEND_VAL_EX                                              'DROP+TABLE+IF+EXISTS+test'
         17        DO_FCALL                                      0  $12     
         18        BOOL_NOT                                         ~13     $12
         19      > JMPNZ_EX                                         ~13     ~13, ->25
         20    >   INIT_METHOD_CALL                                         !0, 'query'
         21        SEND_VAL_EX                                              'CREATE+TABLE+test%28label+LONGTEXT%29'
         22        DO_FCALL                                      0  $14     
         23        BOOL_NOT                                         ~15     $14
         24        BOOL                                             ~13     ~15
         25    > > JMPZ                                                     ~13, ->32
   13    26    >   FETCH_OBJ_R                                      ~16     !0, 'errno'
         27        CONCAT                                           ~17     'Table+creation+failed%3A+%28', ~16
         28        CONCAT                                           ~18     ~17, '%29+'
         29        FETCH_OBJ_R                                      ~19     !0, 'error'
         30        CONCAT                                           ~20     ~18, ~19
         31        ECHO                                                     ~20
   16    32    >   INIT_METHOD_CALL                                         !0, 'query'
         33        SEND_VAL_EX                                              'INSERT+INTO+test%28label%29+values+%28%22test%22%29'
         34        DO_FCALL                                      0          
   22    35        INIT_METHOD_CALL                                         !0, 'prepare'
         36        SEND_VAL_EX                                              'SELECT+label+FROM+test'
         37        DO_FCALL                                      0  $22     
         38        ASSIGN                                                   !1, $22
   23    39        INIT_METHOD_CALL                                         !1, 'execute'
         40        DO_FCALL                                      0          
   24    41        INIT_METHOD_CALL                                         !1, 'bind_result'
         42        SEND_VAR_EX                                              !2
         43        DO_FCALL                                      0          
   25    44      > JMP                                                      ->48
   26    45    >   CAST                                          6  ~26     !2
         46        CONCAT                                           ~27     ~26, '%0A'
         47        ECHO                                                     ~27
   25    48    >   INIT_METHOD_CALL                                         !1, 'fetch'
         49        DO_FCALL                                      0  $28     
         50      > JMPNZ                                                    $28, ->45
   28    51    >   INIT_METHOD_CALL                                         !1, 'close'
         52        DO_FCALL                                      0          
   29    53        INIT_METHOD_CALL                                         !0, 'close'
         54        DO_FCALL                                      0          
   31    55      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.61 ms | 1399 KiB | 13 Q