3v4l.org

run code in 300+ PHP versions simultaneously
<?php $userIds = [1, 2, 3, 4, 5]; $userIdKeys = array_map(function ($index) { return ":userId_{$index}"; }, range(0, count($userIds) - 1)); $userIds = array_combine($userIdKeys, $userIds); $userIdKeyString = implode(',', $userIdKeys); var_dump($userIdKeyString, $userIds);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qKhpU
function name:  (null)
number of ops:  28
compiled vars:  !0 = $userIds, !1 = $userIdKeys, !2 = $userIdKeyString
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%2FqKhpU%3A5%240'
    7     3        SEND_VAL                                                 ~4
          4        INIT_FCALL                                               'range'
          5        SEND_VAL                                                 0
          6        COUNT                                            ~5      !0
          7        SUB                                              ~6      ~5, 1
          8        SEND_VAL                                                 ~6
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                         $8      
    5    12        ASSIGN                                                   !1, $8
    9    13        INIT_FCALL                                               'array_combine'
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !0, $10
   11    18        INIT_FCALL                                               'implode'
         19        SEND_VAL                                                 '%2C'
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !2, $12
   13    23        INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FqKhpU%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qKhpU
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%2FqKhpU%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.63 ms | 1396 KiB | 23 Q