3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 ="Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, <i>graphic</i> or web designs."; $str2 = "laying out print, <i>graphic</i>"; $regex = preg_replace('/\s+/', '\s+', preg_quote($str2, '/')); echo preg_replace("/$regex/iu", '<span style="color:red">$0</span>', $str1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/C2IZT
function name:  (null)
number of ops:  22
compiled vars:  !0 = $str1, !1 = $str2, !2 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Lorem+ipsum%2C+or+lipsum+as+it+is+sometimes+known%2C+is+dummy+text+used+in+laying+out+print%2C+%0A%3Ci%3Egraphic%3C%2Fi%3E+or+web+designs.'
    6     1        ASSIGN                                                   !1, 'laying+++out%0Aprint%2C+%3Ci%3Egraphic%3C%2Fi%3E'
    9     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%5Cs%2B%2F'
          4        SEND_VAL                                                 '%5Cs%2B'
          5        INIT_FCALL                                               'preg_quote'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 '%2F'
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
   11    12        INIT_FCALL                                               'preg_replace'
         13        ROPE_INIT                                     3  ~9      '%2F'
         14        ROPE_ADD                                      1  ~9      ~9, !2
         15        ROPE_END                                      2  ~8      ~9, '%2Fiu'
         16        SEND_VAL                                                 ~8
         17        SEND_VAL                                                 '%3Cspan+style%3D%22color%3Ared%22%3E%240%3C%2Fspan%3E'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $11     
         20        ECHO                                                     $11
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.8 ms | 1016 KiB | 15 Q