3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = [1,2,3,4,5,6,7,8,9,10,11,12]; $ct = 0; $out = array_map(function($v, $y) use (&$ct){ return [$v[$ct++], $y[$ct++]]; }, $x, $x); print_r($out);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q9KIL
function name:  (null)
number of ops:  14
compiled vars:  !0 = $x, !1 = $ct, !2 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 0
    6     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQ9KIL%3A6%240'
          4        BIND_LEXICAL                                             ~5, !1
    8     5        SEND_VAL                                                 ~5
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
    6     9        ASSIGN                                                   !2, $6
   10    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQ9KIL%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q9KIL
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $v, !1 = $y, !2 = $ct
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    7     3        POST_INC                                         ~3      !2
          4        FETCH_DIM_R                                      ~4      !0, ~3
          5        INIT_ARRAY                                       ~5      ~4
          6        POST_INC                                         ~6      !2
          7        FETCH_DIM_R                                      ~7      !1, ~6
          8        ADD_ARRAY_ELEMENT                                ~5      ~7
          9      > RETURN                                                   ~5
    8    10*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQ9KIL%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.39 ms | 1395 KiB | 17 Q