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)){ foreach ($b as $key => $value){ if (is_array($value) && isset($a[$key]) && is_array($a[$key])){ return $merge($a[$key], $value); } else { return $value; } } } 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/i5dlf
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%2Fi5dlf%3A5%240'
          3        BIND_LEXICAL                                             ~5, !2
          4        ASSIGN                                                   !2, ~5
   19     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%2Fi5dlf%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 = 34
Branch analysis from position: 8
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 32
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 32
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
Branch analysis from position: 15
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/i5dlf
function name:  {closure}
number of ops:  36
compiled vars:  !0 = $a, !1 = $b, !2 = $merge, !3 = $value, !4 = $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  ~5      !0
          4      > JMPZ_EX                                          ~5      ~5, ->7
          5    >   TYPE_CHECK                                  128  ~6      !1
          6        BOOL                                             ~5      ~6
          7    > > JMPZ                                                     ~5, ->34
    7     8    > > FE_RESET_R                                       $7      !1, ->32
          9    > > FE_FETCH_R                                       ~8      $7, !3, ->32
         10    >   ASSIGN                                                   !4, ~8
    8    11        TYPE_CHECK                                  128  ~10     !3
         12      > JMPZ_EX                                          ~10     ~10, ->15
         13    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~11     !0, !4
         14        BOOL                                             ~10     ~11
         15    > > JMPZ_EX                                          ~10     ~10, ->19
         16    >   FETCH_DIM_R                                      ~12     !0, !4
         17        TYPE_CHECK                                  128  ~13     ~12
         18        BOOL                                             ~10     ~13
         19    > > JMPZ                                                     ~10, ->29
    9    20    >   INIT_DYNAMIC_CALL                                        !2
         21        CHECK_FUNC_ARG                                           
         22        FETCH_DIM_FUNC_ARG                               $14     !0, !4
         23        SEND_FUNC_ARG                                            $14
         24        SEND_VAR_EX                                              !3
         25        DO_FCALL                                      0  $15     
         26        FE_FREE                                                  $7
         27      > RETURN                                                   $15
         28*       JMP                                                      ->31
   11    29    >   FE_FREE                                                  $7
         30      > RETURN                                                   !3
    7    31*       JMP                                                      ->9
         32    >   FE_FREE                                                  $7
         33      > JMP                                                      ->35
   15    34    > > RETURN                                                   !1
   17    35    > > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.16 ms | 1392 KiB | 15 Q