3v4l.org

run code in 300+ PHP versions simultaneously
<?php function map_deep( $value, $callback ) { if ( is_array( $value ) ) { foreach ( $value as $index => $item ) { $value[ $index ] = map_deep( $item, $callback ); } } elseif ( is_object( $value ) ) { $object_vars = get_object_vars( $value ); foreach ( $object_vars as $property_name => $property_value ) { $value->$property_name = map_deep( $property_value, $callback ); } } else { $value = call_user_func( $callback, $value ); } return $value; } var_dump(map_deep(new ArrayObject([1,2,3]), 'md5'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g3Xkj
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'map_deep'
          2        NEW                                              $0      'ArrayObject'
          3        SEND_VAL_EX                                              <array>
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        SEND_VAL                                                 'md5'
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function map_deep:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 14
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 34
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 32
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 32
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/g3Xkj
function name:  map_deep
number of ops:  40
compiled vars:  !0 = $value, !1 = $callback, !2 = $item, !3 = $index, !4 = $object_vars, !5 = $property_value, !6 = $property_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~7, ->16
    5     4    > > FE_RESET_R                                       $8      !0, ->14
          5    > > FE_FETCH_R                                       ~9      $8, !2, ->14
          6    >   ASSIGN                                                   !3, ~9
    6     7        INIT_FCALL_BY_NAME                                       'map_deep'
          8        SEND_VAR_EX                                              !2
          9        SEND_VAR_EX                                              !1
         10        DO_FCALL                                      0  $12     
         11        ASSIGN_DIM                                               !0, !3
         12        OP_DATA                                                  $12
    5    13      > JMP                                                      ->5
         14    >   FE_FREE                                                  $8
    4    15      > JMP                                                      ->38
    8    16    >   TYPE_CHECK                                  256          !0
         17      > JMPZ                                                     ~13, ->34
    9    18    >   INIT_FCALL                                               'get_object_vars'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $14     
         21        ASSIGN                                                   !4, $14
   10    22      > FE_RESET_R                                       $16     !4, ->32
         23    > > FE_FETCH_R                                       ~17     $16, !5, ->32
         24    >   ASSIGN                                                   !6, ~17
   11    25        INIT_FCALL_BY_NAME                                       'map_deep'
         26        SEND_VAR_EX                                              !5
         27        SEND_VAR_EX                                              !1
         28        DO_FCALL                                      0  $20     
         29        ASSIGN_OBJ                                               !0, !6
         30        OP_DATA                                                  $20
   10    31      > JMP                                                      ->23
         32    >   FE_FREE                                                  $16
    8    33      > JMP                                                      ->38
   14    34    >   INIT_USER_CALL                                1          'call_user_func', !1
         35        SEND_USER                                                !0
         36        DO_FCALL                                      0  $21     
         37        ASSIGN                                                   !0, $21
   17    38    > > RETURN                                                   !0
   18    39*     > RETURN                                                   null

End of function map_deep

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.56 ms | 993 KiB | 16 Q