3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('new','used'); $placeholder = implode( ',', array_fill( 0, count( $array ), '?' ) ); $sql = 'select p.name,p.image from product p where p.condition in (' . $placeholder . ')'; echo $sql;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/q3SO9
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $placeholder, !2 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%2C'
          3        INIT_FCALL                                               'array_fill'
          4        SEND_VAL                                                 0
          5        COUNT                                            ~4      !0
          6        SEND_VAL                                                 ~4
          7        SEND_VAL                                                 '%3F'
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !1, $6
    6    12        CONCAT                                           ~8      'select+p.name%2Cp.image+from+product+p+where++p.condition+in+%28', !1
         13        CONCAT                                           ~9      ~8, '%29'
         14        ASSIGN                                                   !2, ~9
    8    15        ECHO                                                     !2
    9    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.2 ms | 1000 KiB | 15 Q