3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createAttributeCollections($pricingAttributes = null, $permutation = array()){ //permutation result if (empty($pricingAttributes)) { return implode(',', $permutation ); //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')); foreach($results as $result){ echo $result.'<br>'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/AMaRa
function name:  (null)
number of ops:  11
compiled vars:  !0 = $results, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'createattributecollections'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $2      
          3        ASSIGN                                                   !0, $2
   22     4      > FE_RESET_R                                       $4      !0, ->9
          5    > > FE_FETCH_R                                               $4, !1, ->9
   23     6    >   CONCAT                                           ~5      !1, '%3Cbr%3E'
          7        ECHO                                                     ~5
   22     8      > JMP                                                      ->5
          9    >   FE_FREE                                                  $4
   24    10      > RETURN                                                   1

Function createattributecollections:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 14
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 14
Branch analysis from position: 35
Branch analysis from position: 14
filename:       /in/AMaRa
function name:  createAttributeCollections
number of ops:  36
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, ->10
    6     4    >   INIT_FCALL                                               'implode'
          5        SEND_VAL                                                 '%2C'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8      > RETURN                                                   $7
          9*       JMP                                                      ->35
   10    10    >   COUNT                                            ~8      !0
         11        SUB                                              ~9      ~8, 1
         12        ASSIGN                                                   !2, ~9
         13      > JMP                                                      ->33
   11    14    >   ASSIGN                                                   !3, !0
   12    15        ASSIGN                                                   !4, !1
   13    16        INIT_FCALL                                               'array_splice'
         17        SEND_REF                                                 !3
         18        SEND_VAR                                                 !2
         19        SEND_VAL                                                 1
         20        DO_ICALL                                         $13     
         21        FETCH_LIST_R                                     $14     $13, 0
         22        ASSIGN                                                   !5, $14
         23        FREE                                                     $13
   14    24        INIT_FCALL                                               'array_unshift'
         25        SEND_REF                                                 !4
         26        SEND_VAR                                                 !5
         27        DO_ICALL                                                 
   15    28        INIT_FCALL_BY_NAME                                       'createAttributeCollections'
         29        SEND_VAR_EX                                              !3
         30        SEND_VAR_EX                                              !4
         31        DO_FCALL                                      0          
   10    32        PRE_DEC                                                  !2
         33    >   IS_SMALLER_OR_EQUAL                                      0, !2
         34      > JMPNZ                                                    ~19, ->14
   18    35    > > RETURN                                                   null

End of function createattributecollections

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.39 ms | 1403 KiB | 20 Q