3v4l.org

run code in 300+ PHP versions simultaneously
<?php $related = array(1,2,3); $sql = "SELECT id,title,pic1 FROM tbl_products WHERE id IN ("; $sql .= trim(str_repeat("?,",count($related)),","); $sql .= ") LIMIT 3;"; echo $sql;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qot2k
function name:  (null)
number of ops:  15
compiled vars:  !0 = $related, !1 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'SELECT+id%2Ctitle%2Cpic1+FROM+tbl_products+WHERE+id+IN+%28'
    6     2        INIT_FCALL                                               'trim'
          3        INIT_FCALL                                               'str_repeat'
          4        SEND_VAL                                                 '%3F%2C'
          5        COUNT                                            ~4      !0
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        SEND_VAL                                                 '%2C'
         10        DO_ICALL                                         $6      
         11        ASSIGN_OP                                     8          !1, $6
    8    12        ASSIGN_OP                                     8          !1, '%29+LIMIT+3%3B'
   11    13        ECHO                                                     !1
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
226.76 ms | 952 KiB | 15 Q