3v4l.org

run code in 300+ PHP versions simultaneously
<?php function flatten($inputArray) { $output = ''; foreach ($inputArray as $element) { if (is_array($element) == true) { $output .= flatten($element); }else { $output .= $element; } } return $output;}$print = array( 'orange', 'green', array( 'yellow', 'white' ));echo flatten($print);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uNGca
function name:  (null)
number of ops:  6
compiled vars:  !0 = $print
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
          1        INIT_FCALL                                               'flatten'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function flatten:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/uNGca
function name:  flatten
number of ops:  17
compiled vars:  !0 = $inputArray, !1 = $output, !2 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, ''
          2      > FE_RESET_R                                       $4      !0, ->14
          3    > > FE_FETCH_R                                               $4, !2, ->14
    5     4    >   TYPE_CHECK                                  128  ~5      !2
          5        BOOL                                             ~6      ~5
          6      > JMPZ                                                     ~6, ->12
    6     7    >   INIT_FCALL_BY_NAME                                       'flatten'
          8        SEND_VAR_EX                                              !2
          9        DO_FCALL                                      0  $7      
         10        ASSIGN_OP                                     8          !1, $7
         11      > JMP                                                      ->13
    7    12    >   ASSIGN_OP                                     8          !1, !2
    4    13    > > JMP                                                      ->3
         14    >   FE_FREE                                                  $4
    7    15      > RETURN                                                   !1
         16*     > RETURN                                                   null

End of function flatten

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.66 ms | 1399 KiB | 14 Q