3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = 'hello | Hello there price | Lets talk about our support. how are you ?| Im fine '; $word = "price"; if (preg_match('~^\h*' . preg_quote($word, '~') . '\h*\|\h*\K.*\S~m', $data, $match)) { echo $match[0]; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/64J1K
function name:  (null)
number of ops:  17
compiled vars:  !0 = $data, !1 = $word, !2 = $match
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'hello+%7C+Hello+there%0Aprice+%7C+Lets+talk+about+our+support.%0Ahow+are+you+%3F%7C+Im+fine+'
    6     1        ASSIGN                                                       !1, 'price'
    7     2        INIT_FCALL                                                   'preg_match'
          3        INIT_FCALL                                                   'preg_quote'
          4        SEND_VAR                                                     !1
          5        SEND_VAL                                                     '%7E'
          6        DO_ICALL                                             $5      
          7        CONCAT                                               ~6      '%7E%5E%5Ch%2A', $5
          8        CONCAT                                               ~7      ~6, '%5Ch%2A%5C%7C%5Ch%2A%5CK.%2A%5CS%7Em'
          9        SEND_VAL                                                     ~7
         10        SEND_VAR                                                     !0
         11        SEND_REF                                                     !2
         12        DO_ICALL                                             $8      
         13      > JMPZ                                                         $8, ->16
    8    14    >   FETCH_DIM_R                                          ~9      !2, 0
         15        ECHO                                                         ~9
    9    16    > > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
211.11 ms | 2127 KiB | 15 Q