3v4l.org

run code in 300+ PHP versions simultaneously
<?php $alternative = 'offer_type:buy'; $key = 'category:apartment__location_region:shan-south__offer_type:buy'; $result['key'] = 'category:apartment__offer_type:buy_my'; $keyExactMatch = !!array_intersect( array($key, $alternative), array($result['key'], substr($result['key'], null, -3)) ); var_dump($keyExactMatch);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s7YpD
function name:  (null)
number of ops:  26
compiled vars:  !0 = $alternative, !1 = $key, !2 = $result, !3 = $keyExactMatch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'offer_type%3Abuy'
    3     1        ASSIGN                                                   !1, 'category%3Aapartment__location_region%3Ashan-south__offer_type%3Abuy'
    4     2        ASSIGN_DIM                                               !2, 'key'
          3        OP_DATA                                                  'category%3Aapartment__offer_type%3Abuy_my'
    5     4        INIT_FCALL                                               'array_intersect'
    6     5        INIT_ARRAY                                       ~7      !1
          6        ADD_ARRAY_ELEMENT                                ~7      !0
          7        SEND_VAL                                                 ~7
    7     8        FETCH_DIM_R                                      ~8      !2, 'key'
          9        INIT_ARRAY                                       ~9      ~8
         10        INIT_FCALL                                               'substr'
         11        FETCH_DIM_R                                      ~10     !2, 'key'
         12        SEND_VAL                                                 ~10
         13        SEND_VAL                                                 null
         14        SEND_VAL                                                 -3
         15        DO_ICALL                                         $11     
         16        ADD_ARRAY_ELEMENT                                ~9      $11
         17        SEND_VAL                                                 ~9
         18        DO_ICALL                                         $12     
         19        BOOL_NOT                                         ~13     $12
         20        BOOL_NOT                                         ~14     ~13
    5    21        ASSIGN                                                   !3, ~14
    9    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.65 ms | 1395 KiB | 19 Q