3v4l.org

run code in 300+ PHP versions simultaneously
<?php function search($input) { $result = $input; for($a=0;$a<count($input);$a++) { for($b=0;$b<count($input);$a++) { $d=""; for($c=1;$c<$b;$c++) { print $input[$a+$c]; } $result[]= $d; } } foreach($input as $a) foreach($input as $b) $result[]= $a . $b; return array_filter(array_unique($result)); } print json_encode(search(["a", "b"])) . "\n"; print json_encode(search(["a", "b", "c"]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JVfmZ
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'json_encode'
          1        INIT_FCALL                                               'search'
          2        SEND_VAL                                                 <array>
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $1      
          6        CONCAT                                           ~2      $1, '%0A'
          7        ECHO                                                     ~2
   28     8        INIT_FCALL                                               'json_encode'
          9        INIT_FCALL                                               'search'
         10        SEND_VAL                                                 <array>
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                         $4      
         14        ECHO                                                     $4
         15      > RETURN                                                   1

Function search:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 4
Branch analysis from position: 25
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 35
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 35
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 33
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 4
Branch analysis from position: 25
Branch analysis from position: 4
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 9
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 6
Branch analysis from position: 21
Branch analysis from position: 6
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 9
Branch analysis from position: 15
Branch analysis from position: 9
filename:       /in/JVfmZ
function name:  search
number of ops:  44
compiled vars:  !0 = $input, !1 = $result, !2 = $a, !3 = $b, !4 = $d, !5 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, !0
    7     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->22
    9     4    >   ASSIGN                                                   !3, 0
          5      > JMP                                                      ->18
   11     6    >   ASSIGN                                                   !4, ''
   12     7        ASSIGN                                                   !5, 1
          8      > JMP                                                      ->13
   14     9    >   ADD                                              ~11     !2, !5
         10        FETCH_DIM_R                                      ~12     !0, ~11
         11        ECHO                                                     ~12
   12    12        PRE_INC                                                  !5
         13    >   IS_SMALLER                                               !5, !3
         14      > JMPNZ                                                    ~14, ->9
   16    15    >   ASSIGN_DIM                                               !1
         16        OP_DATA                                                  !4
    9    17        PRE_INC                                                  !2
         18    >   COUNT                                            ~17     !0
         19        IS_SMALLER                                               !3, ~17
         20      > JMPNZ                                                    ~18, ->6
    7    21    >   PRE_INC                                                  !2
         22    >   COUNT                                            ~20     !0
         23        IS_SMALLER                                               !2, ~20
         24      > JMPNZ                                                    ~21, ->4
   20    25    > > FE_RESET_R                                       $22     !0, ->35
         26    > > FE_FETCH_R                                               $22, !2, ->35
   21    27    > > FE_RESET_R                                       $23     !0, ->33
         28    > > FE_FETCH_R                                               $23, !3, ->33
   22    29    >   CONCAT                                           ~25     !2, !3
         30        ASSIGN_DIM                                               !1
         31        OP_DATA                                                  ~25
   21    32      > JMP                                                      ->28
         33    >   FE_FREE                                                  $23
   20    34      > JMP                                                      ->26
         35    >   FE_FREE                                                  $22
   24    36        INIT_FCALL                                               'array_filter'
         37        INIT_FCALL                                               'array_unique'
         38        SEND_VAR                                                 !1
         39        DO_ICALL                                         $26     
         40        SEND_VAR                                                 $26
         41        DO_ICALL                                         $27     
         42      > RETURN                                                   $27
   25    43*     > RETURN                                                   null

End of function search

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.82 ms | 1402 KiB | 21 Q