3v4l.org

run code in 300+ PHP versions simultaneously
<?php $courses = array('Eng', 'Deu', 'Bio', 'Chemi'); $placeholders = rtrim(str_repeat('?, ', count($courses)), ', '); $query = "select * from table WHERE class = 'EFG' AND course in ({$placeholders})"; echo $query; /* $stmt = $pdo->prepare($query); $stmt->execute($courses); */
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jcFSv
function name:  (null)
number of ops:  17
compiled vars:  !0 = $courses, !1 = $placeholders, !2 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        INIT_FCALL                                               'rtrim'
          2        INIT_FCALL                                               'str_repeat'
          3        SEND_VAL                                                 '%3F%2C+'
          4        COUNT                                            ~4      !0
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        SEND_VAL                                                 '%2C+'
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !1, $6
    4    11        ROPE_INIT                                     3  ~9      'select+%2A+from+table+WHERE+class+%3D+%27EFG%27+AND+course+in+%28'
         12        ROPE_ADD                                      1  ~9      ~9, !1
         13        ROPE_END                                      2  ~8      ~9, '%29'
         14        ASSIGN                                                   !2, ~8
    5    15        ECHO                                                     !2
    9    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.75 ms | 1399 KiB | 17 Q