3v4l.org

run code in 500+ PHP versions simultaneously
<?php function compare_arrays($input1, $input2) { return strpos(implode(array_map('json_encode', $input1)), implode(array_map('json_encode', $input2))) !== false; } $input1 = ['A', 'B', 'C', 'D', 'E', 'F']; var_dump(compare_arrays($input1, ['B', 'C', 'D'])); var_dump(compare_arrays($input1, ['C', 'D', 'B'])); var_dump(compare_arrays($input1, ['B', 'D', 'E'])); var_dump(compare_arrays($input1, ['A', 'B', 'C'])); var_dump(compare_arrays($input1, ['D', 'E', 'F']));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eAQst
function name:  (null)
number of ops:  37
compiled vars:  !0 = $input1
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                       !0, <array>
    8     1        INIT_FCALL                                                   'var_dump'
          2        INIT_FCALL                                                   'compare_arrays'
          3        SEND_VAR                                                     !0
          4        SEND_VAL                                                     <array>
          5        DO_FCALL                                          0  $2      
          6        SEND_VAR                                                     $2
          7        DO_ICALL                                                     
    9     8        INIT_FCALL                                                   'var_dump'
          9        INIT_FCALL                                                   'compare_arrays'
         10        SEND_VAR                                                     !0
         11        SEND_VAL                                                     <array>
         12        DO_FCALL                                          0  $4      
         13        SEND_VAR                                                     $4
         14        DO_ICALL                                                     
   10    15        INIT_FCALL                                                   'var_dump'
         16        INIT_FCALL                                                   'compare_arrays'
         17        SEND_VAR                                                     !0
         18        SEND_VAL                                                     <array>
         19        DO_FCALL                                          0  $6      
         20        SEND_VAR                                                     $6
         21        DO_ICALL                                                     
   11    22        INIT_FCALL                                                   'var_dump'
         23        INIT_FCALL                                                   'compare_arrays'
         24        SEND_VAR                                                     !0
         25        SEND_VAL                                                     <array>
         26        DO_FCALL                                          0  $8      
         27        SEND_VAR                                                     $8
         28        DO_ICALL                                                     
   12    29        INIT_FCALL                                                   'var_dump'
         30        INIT_FCALL                                                   'compare_arrays'
         31        SEND_VAR                                                     !0
         32        SEND_VAL                                                     <array>
         33        DO_FCALL                                          0  $10     
         34        SEND_VAR                                                     $10
         35        DO_ICALL                                                     
         36      > RETURN                                                       1

Function compare_arrays:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eAQst
function name:  compare_arrays
number of ops:  16
compiled vars:  !0 = $input1, !1 = $input2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
    4     2        INIT_FCALL                                                   'array_map'
          3        SEND_VAL                                                     'json_encode'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $2      
          6        FRAMELESS_ICALL_1                implode             ~3      $2
          7        INIT_FCALL                                                   'array_map'
          8        SEND_VAL                                                     'json_encode'
          9        SEND_VAR                                                     !1
         10        DO_ICALL                                             $4      
         11        FRAMELESS_ICALL_1                implode             ~5      $4
         12        FRAMELESS_ICALL_2                strpos              ~6      ~3, ~5
         13        TYPE_CHECK                                      1018  ~7      ~6
         14      > RETURN                                                       ~7
    5    15*     > RETURN                                                       null

End of function compare_arrays

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
202.42 ms | 1999 KiB | 24 Q