3v4l.org

run code in 300+ PHP versions simultaneously
<?php function findFamily($n) { $numbers = str_split("$n"); $combos = array(); $count = count($numbers); for($i = 0; $i < $count; $i++) { $baseNumber = $numbers[$i]; $tempArray = $numbers; unset($tempArray[$i]); $tempArray = array_values($tempArray); $countTempArray = count($tempArray); for($x = 0; $x < $countTempArray; $x++) { $combonation = ''; $sortedTempArray = array_values($tempArray); for($z = 0; $z < count($sortedTempArray); $z++) $combonation .= $sortedTempArray[$z]; $combos[] = $baseNumber.$combonation; $value = $tempArray[$x]; unset($tempArray[$x]); $tempArray[] = $value; } } return $combos; } print_r(FindFamily("xyz")); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mKXdj
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'findfamily'
          2        SEND_VAL                                                 'xyz'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   25     6      > RETURN                                                   1

Function findfamily:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 11
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 23
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 11
Branch analysis from position: 50
Branch analysis from position: 11
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 30
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 23
Branch analysis from position: 47
Branch analysis from position: 23
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 30
Branch analysis from position: 36
Branch analysis from position: 30
filename:       /in/mKXdj
function name:  findFamily
number of ops:  52
compiled vars:  !0 = $n, !1 = $numbers, !2 = $combos, !3 = $count, !4 = $i, !5 = $baseNumber, !6 = $tempArray, !7 = $countTempArray, !8 = $x, !9 = $combonation, !10 = $sortedTempArray, !11 = $z, !12 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'str_split'
          2        CAST                                          6  ~13     !0
          3        SEND_VAL                                                 ~13
          4        DO_ICALL                                         $14     
          5        ASSIGN                                                   !1, $14
    4     6        ASSIGN                                                   !2, <array>
    5     7        COUNT                                            ~17     !1
          8        ASSIGN                                                   !3, ~17
    6     9        ASSIGN                                                   !4, 0
         10      > JMP                                                      ->48
    7    11    >   FETCH_DIM_R                                      ~20     !1, !4
         12        ASSIGN                                                   !5, ~20
    8    13        ASSIGN                                                   !6, !1
    9    14        UNSET_DIM                                                !6, !4
   10    15        INIT_FCALL                                               'array_values'
         16        SEND_VAR                                                 !6
         17        DO_ICALL                                         $23     
         18        ASSIGN                                                   !6, $23
   11    19        COUNT                                            ~25     !6
         20        ASSIGN                                                   !7, ~25
   12    21        ASSIGN                                                   !8, 0
         22      > JMP                                                      ->45
   13    23    >   ASSIGN                                                   !9, ''
   14    24        INIT_FCALL                                               'array_values'
         25        SEND_VAR                                                 !6
         26        DO_ICALL                                         $29     
         27        ASSIGN                                                   !10, $29
   15    28        ASSIGN                                                   !11, 0
         29      > JMP                                                      ->33
         30    >   FETCH_DIM_R                                      ~32     !10, !11
         31        ASSIGN_OP                                     8          !9, ~32
         32        PRE_INC                                                  !11
         33    >   COUNT                                            ~35     !10
         34        IS_SMALLER                                               !11, ~35
         35      > JMPNZ                                                    ~36, ->30
   16    36    >   CONCAT                                           ~38     !5, !9
         37        ASSIGN_DIM                                               !2
         38        OP_DATA                                                  ~38
   17    39        FETCH_DIM_R                                      ~39     !6, !8
         40        ASSIGN                                                   !12, ~39
   18    41        UNSET_DIM                                                !6, !8
   19    42        ASSIGN_DIM                                               !6
         43        OP_DATA                                                  !12
   12    44        PRE_INC                                                  !8
         45    >   IS_SMALLER                                               !8, !7
         46      > JMPNZ                                                    ~43, ->23
    6    47    >   PRE_INC                                                  !4
         48    >   IS_SMALLER                                               !4, !3
         49      > JMPNZ                                                    ~45, ->11
   22    50    > > RETURN                                                   !2
   23    51*     > RETURN                                                   null

End of function findfamily

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.4 ms | 1403 KiB | 20 Q