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++) { $d = $d . $input[$a+$c]; } print $d; $result[]= $d; } } 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/cCQsB
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     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
   24     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 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 4
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 6
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 4
Branch analysis from position: 27
Branch analysis from position: 4
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 9
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 6
Branch analysis from position: 23
Branch analysis from position: 6
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 9
Branch analysis from position: 16
Branch analysis from position: 9
filename:       /in/cCQsB
function name:  search
number of ops:  35
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
    6     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->24
    8     4    >   ASSIGN                                                   !3, 0
          5      > JMP                                                      ->20
   10     6    >   ASSIGN                                                   !4, ''
   11     7        ASSIGN                                                   !5, 1
          8      > JMP                                                      ->14
   13     9    >   ADD                                              ~11     !2, !5
         10        FETCH_DIM_R                                      ~12     !0, ~11
         11        CONCAT                                           ~13     !4, ~12
         12        ASSIGN                                                   !4, ~13
   11    13        PRE_INC                                                  !5
         14    >   IS_SMALLER                                               !5, !3
         15      > JMPNZ                                                    ~16, ->9
   15    16    >   ECHO                                                     !4
   16    17        ASSIGN_DIM                                               !1
         18        OP_DATA                                                  !4
    8    19        PRE_INC                                                  !2
         20    >   COUNT                                            ~19     !0
         21        IS_SMALLER                                               !3, ~19
         22      > JMPNZ                                                    ~20, ->6
    6    23    >   PRE_INC                                                  !2
         24    >   COUNT                                            ~22     !0
         25        IS_SMALLER                                               !2, ~22
         26      > JMPNZ                                                    ~23, ->4
   20    27    >   INIT_FCALL                                               'array_filter'
         28        INIT_FCALL                                               'array_unique'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $24     
         31        SEND_VAR                                                 $24
         32        DO_ICALL                                         $25     
         33      > RETURN                                                   $25
   21    34*     > RETURN                                                   null

End of function search

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.59 ms | 1394 KiB | 21 Q