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; } var_export(FindFamily("123")); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WDCvP
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'findfamily'
          2        SEND_VAL                                                 '123'
          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 = 47
Branch analysis from position: 47
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 10
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 22
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 49, Position 2 = 10
Branch analysis from position: 49
Branch analysis from position: 10
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 22
Branch analysis from position: 46
Branch analysis from position: 22
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 29
Branch analysis from position: 35
Branch analysis from position: 29
filename:       /in/WDCvP
function name:  findFamily
number of ops:  51
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        SEND_VAR                                                 !0
          3        DO_ICALL                                         $13     
          4        ASSIGN                                                   !1, $13
    4     5        ASSIGN                                                   !2, <array>
    5     6        COUNT                                            ~16     !1
          7        ASSIGN                                                   !3, ~16
    6     8        ASSIGN                                                   !4, 0
          9      > JMP                                                      ->47
    7    10    >   FETCH_DIM_R                                      ~19     !1, !4
         11        ASSIGN                                                   !5, ~19
    8    12        ASSIGN                                                   !6, !1
    9    13        UNSET_DIM                                                !6, !4
   10    14        INIT_FCALL                                               'array_values'
         15        SEND_VAR                                                 !6
         16        DO_ICALL                                         $22     
         17        ASSIGN                                                   !6, $22
   11    18        COUNT                                            ~24     !6
         19        ASSIGN                                                   !7, ~24
   12    20        ASSIGN                                                   !8, 0
         21      > JMP                                                      ->44
   13    22    >   ASSIGN                                                   !9, ''
   14    23        INIT_FCALL                                               'array_values'
         24        SEND_VAR                                                 !6
         25        DO_ICALL                                         $28     
         26        ASSIGN                                                   !10, $28
   15    27        ASSIGN                                                   !11, 0
         28      > JMP                                                      ->32
         29    >   FETCH_DIM_R                                      ~31     !10, !11
         30        ASSIGN_OP                                     8          !9, ~31
         31        PRE_INC                                                  !11
         32    >   COUNT                                            ~34     !10
         33        IS_SMALLER                                               !11, ~34
         34      > JMPNZ                                                    ~35, ->29
   16    35    >   CONCAT                                           ~37     !5, !9
         36        ASSIGN_DIM                                               !2
         37        OP_DATA                                                  ~37
   17    38        FETCH_DIM_R                                      ~38     !6, !8
         39        ASSIGN                                                   !12, ~38
   18    40        UNSET_DIM                                                !6, !8
   19    41        ASSIGN_DIM                                               !6
         42        OP_DATA                                                  !12
   12    43        PRE_INC                                                  !8
         44    >   IS_SMALLER                                               !8, !7
         45      > JMPNZ                                                    ~42, ->22
    6    46    >   PRE_INC                                                  !4
         47    >   IS_SMALLER                                               !4, !3
         48      > JMPNZ                                                    ~44, ->10
   22    49    > > RETURN                                                   !2
   23    50*     > RETURN                                                   null

End of function findfamily

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.58 ms | 1403 KiB | 20 Q