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, graphic or web designs."; $str2 = "laying out print, graphic"; $regex = preg_replace('/\s+/', '\s+', $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/EVIDX
function name:  (null)
number of ops:  18
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+%0Agraphic+or+web+designs.'
    6     1        ASSIGN                                                   !1, 'laying+++out%0Aprint%2C+graphic'
    9     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%2F%5Cs%2B%2F'
          4        SEND_VAL                                                 '%5Cs%2B'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   11     8        INIT_FCALL                                               'preg_replace'
          9        ROPE_INIT                                     3  ~8      '%2F'
         10        ROPE_ADD                                      1  ~8      ~8, !2
         11        ROPE_END                                      2  ~7      ~8, '%2Fiu'
         12        SEND_VAL                                                 ~7
         13        SEND_VAL                                                 '%3Cspan+style%3D%22color%3Ared%22%3E%240%3C%2Fspan%3E'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $10     
         16        ECHO                                                     $10
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
281.3 ms | 1010 KiB | 14 Q