3v4l.org

run code in 300+ PHP versions simultaneously
<?php $db = new PDO("sqlite::memory:"); $db->setAttribute( # raise exceptions PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->query( # you already have a table "CREATE TABLE data (one INT, two INT, three INT, four INT, five INT);"); $stmt = $db->prepare( # prepare query, one placeholding ? for each column left of VALUES "INSERT INTO data (one, two, three, four, five) VALUES(?, ?, ?, ?, ?);"); foreach ([ [1,2,3,4,5], # a row from csv [6,7,8,9,0] # another row from csv ] as $row) { $stmt->execute($row); } $result = $db->query("SELECT * FROM data"); # show it was inserted while ($row = $result->fetch(PDO::FETCH_ASSOC)) { var_dump($row); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 27
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 27
Branch analysis from position: 35
Branch analysis from position: 27
Branch analysis from position: 21
filename:       /in/69DtK
function name:  (null)
number of ops:  36
compiled vars:  !0 = $db, !1 = $stmt, !2 = $row, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'PDO'
          1        SEND_VAL_EX                                              'sqlite%3A%3Amemory%3A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    4     4        INIT_METHOD_CALL                                         !0, 'setAttribute'
    5     5        SEND_VAL_EX                                              3
          6        SEND_VAL_EX                                              2
    4     7        DO_FCALL                                      0          
    7     8        INIT_METHOD_CALL                                         !0, 'query'
    8     9        SEND_VAL_EX                                              'CREATE+TABLE+data+%28one+INT%2C+two+INT%2C+three+INT%2C+four+INT%2C+five+INT%29%3B'
    7    10        DO_FCALL                                      0          
   10    11        INIT_METHOD_CALL                                         !0, 'prepare'
   11    12        SEND_VAL_EX                                              'INSERT+INTO+data+%28one%2C+two%2C+three%2C+four%2C+five%29+VALUES%28%3F%2C+%3F%2C+%3F%2C+%3F%2C+%3F%29%3B'
   10    13        DO_FCALL                                      0  $9      
         14        ASSIGN                                                   !1, $9
   14    15      > FE_RESET_R                                       $11     <array>, ->21
         16    > > FE_FETCH_R                                               $11, !2, ->21
   17    17    >   INIT_METHOD_CALL                                         !1, 'execute'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0          
   14    20      > JMP                                                      ->16
         21    >   FE_FREE                                                  $11
   20    22        INIT_METHOD_CALL                                         !0, 'query'
         23        SEND_VAL_EX                                              'SELECT+%2A+FROM+data'
         24        DO_FCALL                                      0  $13     
         25        ASSIGN                                                   !3, $13
   22    26      > JMP                                                      ->30
   23    27    >   INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !2
         29        DO_ICALL                                                 
   22    30    >   INIT_METHOD_CALL                                         !3, 'fetch'
         31        SEND_VAL_EX                                              2
         32        DO_FCALL                                      0  $16     
         33        ASSIGN                                           ~17     !2, $16
         34      > JMPNZ                                                    ~17, ->27
   25    35    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.04 ms | 1003 KiB | 14 Q