3v4l.org

run code in 300+ PHP versions simultaneously
<?php $db = new pdo('sqlite::memory:', null, null, [PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]); $db->exec('create table foo( n INT UNIQUE );'); $n = 1; $insert = $db->prepare('insert into foo(n) values(:n)'); $insert->bindParam('n', $n); for ($i=0; $i<5; $i++) { try { $insert->execute(); } catch (PDOException $e) { // assuming duplicate $n++; } } var_dump($db->query('select * from foo')->fetchAll(PDO::FETCH_ASSOC));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 21
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 21
Branch analysis from position: 29
Branch analysis from position: 21
Found catch point at position: 24
Branch analysis from position: 24
2 jumps found. (Code = 107) Position 1 = 25, Position 2 = -2
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 21
Branch analysis from position: 29
Branch analysis from position: 21
filename:       /in/D3E2k
function name:  (null)
number of ops:  39
compiled vars:  !0 = $db, !1 = $n, !2 = $insert, !3 = $i, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $5      'pdo'
          1        SEND_VAL_EX                                              'sqlite%3A%3Amemory%3A'
          2        SEND_VAL_EX                                              null
          3        SEND_VAL_EX                                              null
          4        SEND_VAL_EX                                              <array>
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $5
    4     7        INIT_METHOD_CALL                                         !0, 'exec'
          8        SEND_VAL_EX                                              'create+table+foo%28+n+INT+UNIQUE+%29%3B'
          9        DO_FCALL                                      0          
    6    10        ASSIGN                                                   !1, 1
    8    11        INIT_METHOD_CALL                                         !0, 'prepare'
         12        SEND_VAL_EX                                              'insert+into+foo%28n%29+values%28%3An%29'
         13        DO_FCALL                                      0  $10     
         14        ASSIGN                                                   !2, $10
    9    15        INIT_METHOD_CALL                                         !2, 'bindParam'
         16        SEND_VAL_EX                                              'n'
         17        SEND_VAR_EX                                              !1
         18        DO_FCALL                                      0          
   11    19        ASSIGN                                                   !3, 0
         20      > JMP                                                      ->27
   13    21    >   INIT_METHOD_CALL                                         !2, 'execute'
         22        DO_FCALL                                      0          
         23      > JMP                                                      ->26
   14    24  E > > CATCH                                       last         'PDOException'
   16    25    >   PRE_INC                                                  !1
   11    26    >   PRE_INC                                                  !3
         27    >   IS_SMALLER                                               !3, 5
         28      > JMPNZ                                                    ~17, ->21
   20    29    >   INIT_FCALL                                               'var_dump'
         30        INIT_METHOD_CALL                                         !0, 'query'
         31        SEND_VAL_EX                                              'select+%2A+from+foo'
         32        DO_FCALL                                      0  $18     
         33        INIT_METHOD_CALL                                         $18, 'fetchAll'
         34        SEND_VAL_EX                                              2
         35        DO_FCALL                                      0  $19     
         36        SEND_VAR                                                 $19
         37        DO_ICALL                                                 
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.12 ms | 1400 KiB | 15 Q