3v4l.org

run code in 300+ 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 = 8, Position 2 = 21
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/7OXaZ
function name:  (null)
number of ops:  23
compiled vars:  !0 = $My_String, !1 = $strings, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'preg_replace'
          1        SEND_VAL                                                 '%2F%5Ch%2B%2F'
          2        SEND_VAL                                                 '%5B%5Ch-%5D%2B'
          3        SEND_VAL                                                 'alpha+beta+gamma+delta'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    5     6        ASSIGN                                                   !1, <array>
   18     7      > FE_RESET_R                                       $6      !1, ->21
          8    > > FE_FETCH_R                                               $6, !2, ->21
   19     9    >   INIT_FCALL                                               'preg_replace'
         10        ROPE_INIT                                     3  ~8      '%2F%5Cb'
         11        ROPE_ADD                                      1  ~8      ~8, !0
         12        ROPE_END                                      2  ~7      ~8, '%5Cb%2Fi'
         13        SEND_VAL                                                 ~7
         14        SEND_VAL                                                 '%3Cstrong%3E%240%3C%2Fstrong%3E'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !2, $10
   20    18        CONCAT                                           ~12     !2, '%0A'
         19        ECHO                                                     ~12
   18    20      > JMP                                                      ->8
         21    >   FE_FREE                                                  $6
   21    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.87 ms | 998 KiB | 14 Q