3v4l.org

run code in 300+ PHP versions simultaneously
<?php function permutation(array $arr) { while($ele=array_shift($arr)) { $x=$ele; echo $x."\n"; foreach($arr as $rest) { $x.=" $rest"; echo $x."\n"; } } } permutation(array("one","two","three"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nDcLQ
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'permutation'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0          
          3      > RETURN                                                   1

Function permutation:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 13
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 2
Branch analysis from position: 19
Branch analysis from position: 2
Branch analysis from position: 13
filename:       /in/nDcLQ
function name:  permutation
number of ops:  20
compiled vars:  !0 = $arr, !1 = $x, !2 = $ele, !3 = $rest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1      > JMP                                                      ->14
    6     2    >   ASSIGN                                                   !1, !2
    7     3        CONCAT                                           ~5      !1, '%0A'
          4        ECHO                                                     ~5
    8     5      > FE_RESET_R                                       $6      !0, ->13
          6    > > FE_FETCH_R                                               $6, !3, ->13
   10     7    >   NOP                                                      
          8        FAST_CONCAT                                      ~7      '+', !3
          9        ASSIGN_OP                                     8          !1, ~7
   11    10        CONCAT                                           ~9      !1, '%0A'
         11        ECHO                                                     ~9
    8    12      > JMP                                                      ->6
         13    >   FE_FREE                                                  $6
    4    14    >   INIT_FCALL                                               'array_shift'
         15        SEND_REF                                                 !0
         16        DO_ICALL                                         $10     
         17        ASSIGN                                           ~11     !2, $10
         18      > JMPNZ                                                    ~11, ->2
   14    19    > > RETURN                                                   null

End of function permutation

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.58 ms | 1390 KiB | 16 Q