3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dictionary = array('sheet set', 'jacket', 'suit', 'oxford shoes'); $regexp = implode('|', $dictionary); $regexp .= '|[a-z]{2,}'; $regexp = '/(?<=[^\w-]|^)('.$regexp.')(?=[^\w-]|$)/i'; var_dump($regexp); $subject = '4-Piece 1000TC 100% Cotton Queen Sheet Set in Ivory'; preg_match_all($regexp, $subject, $matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/siK9h
function name:  (null)
number of ops:  20
compiled vars:  !0 = $dictionary, !1 = $regexp, !2 = $subject, !3 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        FRAMELESS_ICALL_2                implode             ~5      '%7C', !0
          2        ASSIGN                                                       !1, ~5
    5     3        ASSIGN_OP                                         8          !1, '%7C%5Ba-z%5D%7B2%2C%7D'
    6     4        CONCAT                                               ~8      '%2F%28%3F%3C%3D%5B%5E%5Cw-%5D%7C%5E%29%28', !1
          5        CONCAT                                               ~9      ~8, '%29%28%3F%3D%5B%5E%5Cw-%5D%7C%24%29%2Fi'
          6        ASSIGN                                                       !1, ~9
    7     7        INIT_FCALL                                                   'var_dump'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                                     
    9    10        ASSIGN                                                       !2, '4-Piece+1000TC+100%25+Cotton+Queen+Sheet+Set+in+Ivory'
   11    11        INIT_FCALL                                                   'preg_match_all'
         12        SEND_VAR                                                     !1
         13        SEND_VAR                                                     !2
         14        SEND_REF                                                     !3
         15        DO_ICALL                                                     
   13    16        INIT_FCALL                                                   'var_dump'
         17        SEND_VAR                                                     !3
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
184 ms | 3500 KiB | 15 Q