3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'An aim is a goal or objective Hotel in Canada to achieve in life. In order to succeed in life, one must have Hotel in, Canada a goal. My aim in life is to be a teacher. Teaching is a noble and responsible profession. I have come City Hotels to know that the ever-increasing misery and distress, are City, Hotels due to the ignorance and illiteracy City. Hotels of the people of our country. So I have decided to spread education among the masses Hotel. in Canada as much as possible within my humble power. As a teacher, I shall try my best to impart man-making education.'; $keywords = ['City Hotels', 'Hotel in Canada']; foreach ($keywords as $keyword) { $regex = preg_replace('/ +/', '[.,\s]+', preg_quote($keyword, '/')); $string = preg_replace("/\b$regex\b/iu", '**$0**', $string); } var_export($string);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 24
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/a4eeV
function name:  (null)
number of ops:  29
compiled vars:  !0 = $string, !1 = $keywords, !2 = $keyword, !3 = $regex
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'An+aim+is+a+goal+or+objective+Hotel+in+Canada+to+achieve+in+life.+In+order+to+succeed+in+life%2C+one+must+have+Hotel+in%2C+Canada+a+goal.+My+aim+in+life+is+to+be+a+teacher.+Teaching+is+a+noble+and+responsible+profession.+I+have+come+City+Hotels+to+know+that+the+ever-increasing+misery+and+distress%2C+are+City%2C+Hotels+due+to+the+ignorance+and+illiteracy+City.+Hotels+of+the+people+of+our+country.+So+I+have+decided+to+spread+education+among+the+masses+Hotel.+in+Canada+as+much+as+possible+within+my+humble+power.+As+a+teacher%2C+I+shall+try+my+best+to+impart+man-making+education.'
    5     1        ASSIGN                                                   !1, <array>
    7     2      > FE_RESET_R                                       $6      !1, ->24
          3    > > FE_FETCH_R                                               $6, !2, ->24
    8     4    >   INIT_FCALL                                               'preg_replace'
          5        SEND_VAL                                                 '%2F+%2B%2F'
          6        SEND_VAL                                                 '%5B.%2C%5Cs%5D%2B'
          7        INIT_FCALL                                               'preg_quote'
          8        SEND_VAR                                                 !2
          9        SEND_VAL                                                 '%2F'
         10        DO_ICALL                                         $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !3, $8
    9    14        INIT_FCALL                                               'preg_replace'
         15        ROPE_INIT                                     3  ~11     '%2F%5Cb'
         16        ROPE_ADD                                      1  ~11     ~11, !3
         17        ROPE_END                                      2  ~10     ~11, '%5Cb%2Fiu'
         18        SEND_VAL                                                 ~10
         19        SEND_VAL                                                 '%2A%2A%240%2A%2A'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $13     
         22        ASSIGN                                                   !0, $13
    7    23      > JMP                                                      ->3
         24    >   FE_FREE                                                  $6
   11    25        INIT_FCALL                                               'var_export'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.78 ms | 1013 KiB | 16 Q