3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array('a' => 'a', 'b' => 'b', 'z' => array('c' => 'c', 'd' => 'd')); $b = array('a' => 'c', 'z' => array('c' => 'e')); $merge = function($a, $b) use (&$merge){ if (is_array($a) && is_array($b)){ $return = array(); foreach ($b as $key => $value){ if (is_array($value) && isset($a[$key]) && is_array($a[$key])){ $return[] = $merge($a[$key], $value); } else { $return[] = $value; } } return $return; } else { return $b; } }; var_dump($merge($a, $b));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V2Glo
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $merge
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FV2Glo%3A5%240'
          3        BIND_LEXICAL                                             ~5, !2
          4        ASSIGN                                                   !2, ~5
   21     5        INIT_FCALL                                               'var_dump'
          6        INIT_DYNAMIC_CALL                                        !2
          7        SEND_VAR_EX                                              !0
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0  $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FV2Glo%3A5%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 36
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 33
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 33
Branch analysis from position: 11
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 30
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 20
Branch analysis from position: 16
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/V2Glo
function name:  {closure}
number of ops:  38
compiled vars:  !0 = $a, !1 = $b, !2 = $merge, !3 = $return, !4 = $value, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
    6     3        TYPE_CHECK                                  128  ~6      !0
          4      > JMPZ_EX                                          ~6      ~6, ->7
          5    >   TYPE_CHECK                                  128  ~7      !1
          6        BOOL                                             ~6      ~7
          7    > > JMPZ                                                     ~6, ->36
    7     8    >   ASSIGN                                                   !3, <array>
    8     9      > FE_RESET_R                                       $9      !1, ->33
         10    > > FE_FETCH_R                                       ~10     $9, !4, ->33
         11    >   ASSIGN                                                   !5, ~10
    9    12        TYPE_CHECK                                  128  ~12     !4
         13      > JMPZ_EX                                          ~12     ~12, ->16
         14    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~13     !0, !5
         15        BOOL                                             ~12     ~13
         16    > > JMPZ_EX                                          ~12     ~12, ->20
         17    >   FETCH_DIM_R                                      ~14     !0, !5
         18        TYPE_CHECK                                  128  ~15     ~14
         19        BOOL                                             ~12     ~15
         20    > > JMPZ                                                     ~12, ->30
   10    21    >   INIT_DYNAMIC_CALL                                        !2
         22        CHECK_FUNC_ARG                                           
         23        FETCH_DIM_FUNC_ARG                               $17     !0, !5
         24        SEND_FUNC_ARG                                            $17
         25        SEND_VAR_EX                                              !4
         26        DO_FCALL                                      0  $18     
         27        ASSIGN_DIM                                               !3
         28        OP_DATA                                                  $18
         29      > JMP                                                      ->32
   12    30    >   ASSIGN_DIM                                               !3
         31        OP_DATA                                                  !4
    8    32    > > JMP                                                      ->10
         33    >   FE_FREE                                                  $9
   15    34      > RETURN                                                   !3
         35*       JMP                                                      ->37
   17    36    > > RETURN                                                   !1
   19    37*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.97 ms | 1400 KiB | 15 Q