3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userIds = [1, 2]; $userIdKeys = array_map(function ($index) { return ":userId_{$index}"; }, range(0, count($userIds) - 1)); $userIds = array_combine($userIdKeys, $userIds); $userIdKeyString = implode(', ', $userIdKeys); $sql = "SELECT * FROM user WHERE userId IN ({$userIdKeyString});"; var_dump($sql, $userIds);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6l6cP
function name:  (null)
number of ops:  32
compiled vars:  !0 = $userIds, !1 = $userIdKeys, !2 = $userIdKeyString, !3 = $sql
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'array_map'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F6l6cP%3A5%240'
    7     3        SEND_VAL                                                 ~5
          4        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 0
          6        COUNT                                            ~6      !0
          7        SUB                                              ~7      ~6, 1
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                         $9      
    5    12        ASSIGN                                                   !1, $9
    9    13        INIT_FCALL                                               'array_combine'
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $11     
         17        ASSIGN                                                   !0, $11
   10    18        INIT_FCALL                                               'implode'
         19        SEND_VAL                                                 '%2C+'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !2, $13
   11    23        ROPE_INIT                                     3  ~16     'SELECT+%2A+FROM+user+WHERE+userId+IN+%28'
         24        ROPE_ADD                                      1  ~16     ~16, !2
         25        ROPE_END                                      2  ~15     ~16, '%29%3B'
         26        ASSIGN                                                   !3, ~15
   13    27        INIT_FCALL                                               'var_dump'
         28        SEND_VAR                                                 !3
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F6l6cP%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6l6cP
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $index
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        NOP                                                      
          2        FAST_CONCAT                                      ~1      '%3AuserId_', !0
          3      > RETURN                                                   ~1
    7     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F6l6cP%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.48 ms | 1396 KiB | 23 Q