3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = array("apple","orange","papaya","grape","apple juice", "applecurd"); $content = "eaplp"; $content = str_split($content); $count = count($content); Foreach($fruits as $fruit){ $arr_fruit = str_split($fruit); $SortCont = array_merge(array_intersect($arr_fruit, $content), array_diff($content, $arr_fruit)); If(array_slice($SortCont, 0, $count) == array_slice($arr_fruit, 0, $count)){ Echo "match: " . $fruit ."\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 43
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 43
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 42
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 42
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 43
filename:       /in/hHvp3
function name:  (null)
number of ops:  45
compiled vars:  !0 = $fruits, !1 = $content, !2 = $count, !3 = $fruit, !4 = $arr_fruit, !5 = $SortCont
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'eaplp'
    5     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
    6     6        COUNT                                            ~10     !1
          7        ASSIGN                                                   !2, ~10
    8     8      > FE_RESET_R                                       $12     !0, ->43
          9    > > FE_FETCH_R                                               $12, !3, ->43
    9    10    >   INIT_FCALL                                               'str_split'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !4, $13
   10    14        INIT_FCALL                                               'array_merge'
         15        INIT_FCALL                                               'array_intersect'
         16        SEND_VAR                                                 !4
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $15     
         19        SEND_VAR                                                 $15
         20        INIT_FCALL                                               'array_diff'
         21        SEND_VAR                                                 !1
         22        SEND_VAR                                                 !4
         23        DO_ICALL                                         $16     
         24        SEND_VAR                                                 $16
         25        DO_ICALL                                         $17     
         26        ASSIGN                                                   !5, $17
   11    27        INIT_FCALL                                               'array_slice'
         28        SEND_VAR                                                 !5
         29        SEND_VAL                                                 0
         30        SEND_VAR                                                 !2
         31        DO_ICALL                                         $19     
         32        INIT_FCALL                                               'array_slice'
         33        SEND_VAR                                                 !4
         34        SEND_VAL                                                 0
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                         $20     
         37        IS_EQUAL                                                 $19, $20
         38      > JMPZ                                                     ~21, ->42
   12    39    >   CONCAT                                           ~22     'match%3A+', !3
         40        CONCAT                                           ~23     ~22, '%0A'
         41        ECHO                                                     ~23
    8    42    > > JMP                                                      ->9
         43    >   FE_FREE                                                  $12
   14    44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.27 ms | 1404 KiB | 23 Q