3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createAttributeCollections($pricingAttributes = null, $permutation = array()){ //permutation result if (empty($pricingAttributes)) { echo implode(',', $permutation )."\n"; //permutation } else { //permutation loop for ($i = count($pricingAttributes) - 1; $i >= 0; --$i) { $newpricingAttributes = $pricingAttributes; $newPermutations = $permutation; list($foo) = array_splice($newpricingAttributes, $i, 1); array_unshift($newPermutations, $foo); createAttributeCollections($newpricingAttributes, $newPermutations); } } } $results = createAttributeCollections(array('A','B','G','U'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmEP3
function name:  (null)
number of ops:  5
compiled vars:  !0 = $results
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'createattributecollections'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
          4      > RETURN                                                   1

Function createattributecollections:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 15
Branch analysis from position: 36
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 15
Branch analysis from position: 36
Branch analysis from position: 15
filename:       /in/qmEP3
function name:  createAttributeCollections
number of ops:  37
compiled vars:  !0 = $pricingAttributes, !1 = $permutation, !2 = $i, !3 = $newpricingAttributes, !4 = $newPermutations, !5 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      <array>
    5     2        ISSET_ISEMPTY_CV                                         !0
          3      > JMPZ                                                     ~6, ->11
    6     4    >   INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '%2C'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        CONCAT                                           ~8      $7, '%0A'
          9        ECHO                                                     ~8
         10      > JMP                                                      ->36
   10    11    >   COUNT                                            ~9      !0
         12        SUB                                              ~10     ~9, 1
         13        ASSIGN                                                   !2, ~10
         14      > JMP                                                      ->34
   11    15    >   ASSIGN                                                   !3, !0
   12    16        ASSIGN                                                   !4, !1
   13    17        INIT_FCALL                                               'array_splice'
         18        SEND_REF                                                 !3
         19        SEND_VAR                                                 !2
         20        SEND_VAL                                                 1
         21        DO_ICALL                                         $14     
         22        FETCH_LIST_R                                     $15     $14, 0
         23        ASSIGN                                                   !5, $15
         24        FREE                                                     $14
   14    25        INIT_FCALL                                               'array_unshift'
         26        SEND_REF                                                 !4
         27        SEND_VAR                                                 !5
         28        DO_ICALL                                                 
   15    29        INIT_FCALL_BY_NAME                                       'createAttributeCollections'
         30        SEND_VAR_EX                                              !3
         31        SEND_VAR_EX                                              !4
         32        DO_FCALL                                      0          
   10    33        PRE_DEC                                                  !2
         34    >   IS_SMALLER_OR_EQUAL                                      0, !2
         35      > JMPNZ                                                    ~20, ->15
   18    36    > > RETURN                                                   null

End of function createattributecollections

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.13 ms | 1403 KiB | 20 Q