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);$b++) { $d=""; for($c=0;$c<=$b;$c++) { $d = $d . $input[$a+$c]; } $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/JX1hZ
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 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 4
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 6
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 4
Branch analysis from position: 26
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 = 22, Position 2 = 6
Branch analysis from position: 22
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/JX1hZ
function name:  search
number of ops:  34
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                                                      ->23
    9     4    >   ASSIGN                                                   !3, 0
          5      > JMP                                                      ->19
   11     6    >   ASSIGN                                                   !4, ''
   12     7        ASSIGN                                                   !5, 0
          8      > JMP                                                      ->14
   14     9    >   ADD                                              ~11     !2, !5
         10        FETCH_DIM_R                                      ~12     !0, ~11
         11        CONCAT                                           ~13     !4, ~12
         12        ASSIGN                                                   !4, ~13
   12    13        PRE_INC                                                  !5
         14    >   IS_SMALLER_OR_EQUAL                                      !5, !3
         15      > JMPNZ                                                    ~16, ->9
   16    16    >   ASSIGN_DIM                                               !1
         17        OP_DATA                                                  !4
    9    18        PRE_INC                                                  !3
         19    >   COUNT                                            ~19     !0
         20        IS_SMALLER                                               !3, ~19
         21      > JMPNZ                                                    ~20, ->6
    7    22    >   PRE_INC                                                  !2
         23    >   COUNT                                            ~22     !0
         24        IS_SMALLER                                               !2, ~22
         25      > JMPNZ                                                    ~23, ->4
   20    26    >   INIT_FCALL                                               'array_filter'
         27        INIT_FCALL                                               'array_unique'
         28        SEND_VAR                                                 !1
         29        DO_ICALL                                         $24     
         30        SEND_VAR                                                 $24
         31        DO_ICALL                                         $25     
         32      > RETURN                                                   $25
   21    33*     > RETURN                                                   null

End of function search

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.99 ms | 1394 KiB | 21 Q