3v4l.org

run code in 300+ PHP versions simultaneously
<?php function search($input) { $result = $input; 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/l9TqO
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     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
   15     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
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 10
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/l9TqO
function name:  search
number of ops:  21
compiled vars:  !0 = $input, !1 = $result, !2 = $a, !3 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, !0
    6     2      > FE_RESET_R                                       $5      !0, ->12
          3    > > FE_FETCH_R                                               $5, !2, ->12
    7     4    > > FE_RESET_R                                       $6      !0, ->10
          5    > > FE_FETCH_R                                               $6, !3, ->10
    8     6    >   CONCAT                                           ~8      !2, !3
          7        ASSIGN_DIM                                               !1
          8        OP_DATA                                                  ~8
    7     9      > JMP                                                      ->5
         10    >   FE_FREE                                                  $6
    6    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $5
   10    13        INIT_FCALL                                               'array_filter'
         14        INIT_FCALL                                               'array_unique'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                         $10     
         19      > RETURN                                                   $10
   11    20*     > RETURN                                                   null

End of function search

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.05 ms | 1402 KiB | 21 Q