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_grep($pattern, explode(' ', $string)); print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ugbdZ
function name:  (null)
number of ops:  27
compiled vars:  !0 = $string, !1 = $search, !2 = $pattern, !3 = $arr
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                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                         $7      
         11        CONCAT                                           ~8      '%2F%5Cb%28', $7
         12        CONCAT                                           ~9      ~8, '%29%5Cb%2Fi'
         13        ASSIGN                                                   !2, ~9
    7    14        INIT_FCALL                                               'preg_grep'
         15        SEND_VAR                                                 !2
         16        INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '+'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $11     
         20        SEND_VAR                                                 $11
         21        DO_ICALL                                         $12     
         22        ASSIGN                                                   !3, $12
   10    23        INIT_FCALL                                               'print_r'
         24        SEND_VAR                                                 !3
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.81 ms | 1015 KiB | 18 Q