3v4l.org

run code in 500+ 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 = 18
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/a4eeV
function name:  (null)
number of ops:  23
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, ->18
          3    > > FE_FETCH_R                                                   $6, !2, ->18
    8     4    >   INIT_FCALL                                                   'preg_quote'
          5        SEND_VAR                                                     !2
          6        SEND_VAL                                                     '%2F'
          7        DO_ICALL                                             $7      
          8        FRAMELESS_ICALL_3                preg_replace        ~8      '%2F+%2B%2F', '%5B.%2C%5Cs%5D%2B'
          9        OP_DATA                                                      $7
         10        ASSIGN                                                       !3, ~8
    9    11        ROPE_INIT                                         3  ~11     '%2F%5Cb'
         12        ROPE_ADD                                          1  ~11     ~11, !3
         13        ROPE_END                                          2  ~10     ~11, '%5Cb%2Fiu'
         14        FRAMELESS_ICALL_3                preg_replace        ~13     ~10, '%2A%2A%240%2A%2A'
         15        OP_DATA                                                      !0
         16        ASSIGN                                                       !0, ~13
    7    17      > JMP                                                          ->3
         18    >   FE_FREE                                                      $6
   11    19        INIT_FCALL                                                   'var_export'
         20        SEND_VAR                                                     !0
         21        DO_ICALL                                                     
         22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.35 ms | 1986 KiB | 15 Q