3v4l.org

run code in 300+ PHP versions simultaneously
<?php function transform(array $input): array { $output = []; foreach($input as $k => $v) { if(is_array($v)) { $output[$k] = transform($v); } else { $output[$k] = $v * 10; } } return $output; } $input = [ 'parent1' => [ 'subArray1' => [ 'value1' => '1', 'value2' => '2' ], 'value3' => '3', 'subArray2' =>[ 'subSubArray2' => [ 'value1' => '1', 'value4' => '4' ] ] ], 'parent2' => [ 'subArray1' => [ 'value1' => '1', 'value2' => '2' ], 'value5' => '5', 'subArray2' =>[ 'subSubArray2' => [ 'value1' => '1', 'value4' => '4' ] ] ] ]; var_dump(transform($input));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GES9k
function name:  (null)
number of ops:  8
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   ASSIGN                                                   !0, <array>
   51     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'transform'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function transform:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/GES9k
function name:  transform
number of ops:  22
compiled vars:  !0 = $input, !1 = $output, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $5      !0, ->17
          3    > > FE_FETCH_R                                       ~6      $5, !2, ->17
          4    >   ASSIGN                                                   !3, ~6
    8     5        TYPE_CHECK                                  128          !2
          6      > JMPZ                                                     ~8, ->13
   10     7    >   INIT_FCALL_BY_NAME                                       'transform'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $10     
         10        ASSIGN_DIM                                               !1, !3
         11        OP_DATA                                                  $10
         12      > JMP                                                      ->16
   14    13    >   MUL                                              ~12     !2, 10
         14        ASSIGN_DIM                                               !1, !3
         15        OP_DATA                                                  ~12
    6    16    > > JMP                                                      ->3
         17    >   FE_FREE                                                  $5
   18    18        VERIFY_RETURN_TYPE                                       !1
         19      > RETURN                                                   !1
   19    20*       VERIFY_RETURN_TYPE                                       
         21*     > RETURN                                                   null

End of function transform

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.91 ms | 1399 KiB | 16 Q