3v4l.org

run code in 300+ PHP versions simultaneously
<?php $first = array(1,2,3); $last = array(4,5,6); $k = 10; $array = array_map(function ($first, $last) { return array("first" => $first, "last" => $last); }, $first, $last); echo json_encode(array('id' =>$k, 'name' => $array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3p2fE
function name:  (null)
number of ops:  17
compiled vars:  !0 = $first, !1 = $last, !2 = $k, !3 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 10
    6     3        INIT_FCALL                                               'array_map'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3p2fE%3A6%240'
          5        SEND_VAL                                                 ~7
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !3, $8
    7    10        INIT_FCALL                                               'json_encode'
         11        INIT_ARRAY                                       ~10     !2, 'id'
         12        ADD_ARRAY_ELEMENT                                ~10     !3, 'name'
         13        SEND_VAL                                                 ~10
         14        DO_ICALL                                         $11     
         15        ECHO                                                     $11
         16      > RETURN                                                   1

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

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.24 ms | 1399 KiB | 17 Q