3v4l.org

run code in 500+ PHP versions simultaneously
<?php $My_String = preg_replace("/\h+/", "[\h-]+", "alpha beta gamma delta"); $strings = [ "My codephrase is alPha Beta-GaMMa deLTa and your codephrase is ALpha-beTA gAmmA-DElta", "alpha beta gamma delta", "alpha beta gamma-delta", "alpha beta-gamma delta", "alpha beta-gamma-delta", "alpha-beta gamma delta", "alpha-beta gamma-delta", "alpha-beta-gamma delta", "alpha-beta-gamma-delta", "alpha-beta-gamma-d" ]; foreach ($strings as $str) { $str = preg_replace("/\b$My_String\b/i", "<strong>$0</strong>", $str); echo $str . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/7OXaZ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $My_String, !1 = $strings, !2 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   FRAMELESS_ICALL_3                preg_replace        ~3      '%2F%5Ch%2B%2F', '%5B%5Ch-%5D%2B'
          1        OP_DATA                                                      'alpha+beta+gamma+delta'
          2        ASSIGN                                                       !0, ~3
    5     3        ASSIGN                                                       !1, <array>
   18     4      > FE_RESET_R                                           $6      !1, ->15
          5    > > FE_FETCH_R                                                   $6, !2, ->15
   19     6    >   ROPE_INIT                                         3  ~8      '%2F%5Cb'
          7        ROPE_ADD                                          1  ~8      ~8, !0
          8        ROPE_END                                          2  ~7      ~8, '%5Cb%2Fi'
          9        FRAMELESS_ICALL_3                preg_replace        ~10     ~7, '%3Cstrong%3E%240%3C%2Fstrong%3E'
         10        OP_DATA                                                      !2
         11        ASSIGN                                                       !2, ~10
   20    12        CONCAT                                               ~12     !2, '%0A'
         13        ECHO                                                         ~12
   18    14      > JMP                                                          ->5
         15    >   FE_FREE                                                      $6
   21    16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.07 ms | 2090 KiB | 13 Q