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_map('array_values', $tempArray); for($i = 0; $i < count($tempArray); $i++) { $combos[] = $baseNumber.$tempArray[$i].$tempArray[$i + 1]; $value = $tempArray[$i]; unset($tempArray[$i]); $numbers[] = $value; } } return $combos; } print_r(FindFamily(123));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T33a4
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'findfamily'
          2        SEND_VAL                                                 123
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

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

End of function findfamily

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.24 ms | 1403 KiB | 20 Q