3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentence='This is the sentence to be searhed through'; $search = 'sent'; $result = preg_replace("/" . preg_quote($search, "/") . "/ui", "<strong style='color:yellow'>$0</strong>", $sentence); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/X69hk
function name:  (null)
number of ops:  16
compiled vars:  !0 = $sentence, !1 = $search, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'This+is+the+sentence+to+be+searhed+through'
    4     1        ASSIGN                                                   !1, 'sent'
    5     2        INIT_FCALL                                               'preg_replace'
          3        INIT_FCALL                                               'preg_quote'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 '%2F'
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      '%2F', $5
          8        CONCAT                                           ~7      ~6, '%2Fui'
          9        SEND_VAL                                                 ~7
         10        SEND_VAL                                                 '%3Cstrong+style%3D%27color%3Ayellow%27%3E%240%3C%2Fstrong%3E'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    6    14        ECHO                                                     !2
    7    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.63 ms | 998 KiB | 15 Q