3v4l.org

run code in 300+ PHP versions simultaneously
<?php $table = 'test'; $tableNames= array('col1' => 'str', 'col2' => 3, 'col4' => 5.5); $query = "INSERT INTO $table ("; $query .= implode(', ', array_keys($tableNames)); $query .= ") VALUES ("; $query .= str_repeat('?, ', count($tableNames) - 1); $query .= "?)"; echo $query; $types = str_repeat('s', count($tableNames)); $stmt->bind_param($types, ...$tableNames);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SleN0
function name:  (null)
number of ops:  36
compiled vars:  !0 = $table, !1 = $tableNames, !2 = $query, !3 = $types, !4 = $stmt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'test'
    4     1        ASSIGN                                                   !1, <array>
    6     2        ROPE_INIT                                     3  ~8      'INSERT+INTO+'
          3        ROPE_ADD                                      1  ~8      ~8, !0
          4        ROPE_END                                      2  ~7      ~8, '+%28'
          5        ASSIGN                                                   !2, ~7
    7     6        INIT_FCALL                                               'implode'
          7        SEND_VAL                                                 '%2C+'
          8        INIT_FCALL                                               'array_keys'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $11     
         11        SEND_VAR                                                 $11
         12        DO_ICALL                                         $12     
         13        ASSIGN_OP                                     8          !2, $12
    8    14        ASSIGN_OP                                     8          !2, '%29+VALUES+%28'
    9    15        INIT_FCALL                                               'str_repeat'
         16        SEND_VAL                                                 '%3F%2C+'
         17        COUNT                                            ~15     !1
         18        SUB                                              ~16     ~15, 1
         19        SEND_VAL                                                 ~16
         20        DO_ICALL                                         $17     
         21        ASSIGN_OP                                     8          !2, $17
   10    22        ASSIGN_OP                                     8          !2, '%3F%29'
   12    23        ECHO                                                     !2
   14    24        INIT_FCALL                                               'str_repeat'
         25        SEND_VAL                                                 's'
         26        COUNT                                            ~20     !1
         27        SEND_VAL                                                 ~20
         28        DO_ICALL                                         $21     
         29        ASSIGN                                                   !3, $21
   15    30        INIT_METHOD_CALL                                         !4, 'bind_param'
         31        SEND_VAR_EX                                              !3
         32        SEND_UNPACK                                              !1
         33        CHECK_UNDEF_ARGS                                         
         34        DO_FCALL                                      1          
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.1 ms | 1008 KiB | 16 Q