3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Apple is a big tech company!"; $search = 'Apple Logo a'; $pattern = '/\b('.str_replace(' ', '|', preg_quote($search, '/')).')\b/i'; $arr = preg_match_all($pattern,$string,$matches); print_r($arr); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZOlUV
function name:  (null)
number of ops:  27
compiled vars:  !0 = $string, !1 = $search, !2 = $pattern, !3 = $arr, !4 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Apple+is+a+big+tech+company%21'
    3     1        ASSIGN                                                   !1, 'Apple+Logo+a'
    5     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '+'
          4        SEND_VAL                                                 '%7C'
          5        INIT_FCALL                                               'preg_quote'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 '%2F'
          8        DO_ICALL                                         $7      
          9        SEND_VAR                                                 $7
         10        DO_ICALL                                         $8      
         11        CONCAT                                           ~9      '%2F%5Cb%28', $8
         12        CONCAT                                           ~10     ~9, '%29%5Cb%2Fi'
         13        ASSIGN                                                   !2, ~10
    7    14        INIT_FCALL                                               'preg_match_all'
         15        SEND_VAR                                                 !2
         16        SEND_VAR                                                 !0
         17        SEND_REF                                                 !4
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !3, $12
   10    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
   13    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.38 ms | 1013 KiB | 17 Q