3v4l.org

run code in 300+ PHP versions simultaneously
<?php function str_replace_word($needle,$replacement,$haystack){ $pattern = "/\b$needle\b/i"; $haystack = preg_replace($pattern, $replacement, $haystack); return $haystack; } $str = "ann@ibbeck.de,Petermann@ibbeck.de"; $str = str_replace_word('ann@ibbeck.de','kan',"ann@ibbeck.de,Petermann@ibbeck.de"); $str = str_replace_word('Petermann@ibbeck.de','AP',$str); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5HO0
function name:  (null)
number of ops:  14
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 'ann%40ibbeck.de%2CPetermann%40ibbeck.de'
   10     1        INIT_FCALL                                               'str_replace_word'
          2        SEND_VAL                                                 'ann%40ibbeck.de'
          3        SEND_VAL                                                 'kan'
          4        SEND_VAL                                                 'ann%40ibbeck.de%2CPetermann%40ibbeck.de'
          5        DO_FCALL                                      0  $2      
          6        ASSIGN                                                   !0, $2
   11     7        INIT_FCALL                                               'str_replace_word'
          8        SEND_VAL                                                 'Petermann%40ibbeck.de'
          9        SEND_VAL                                                 'AP'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $4      
         12        ASSIGN                                                   !0, $4
   12    13      > RETURN                                                   1

Function str_replace_word:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/k5HO0
function name:  str_replace_word
number of ops:  15
compiled vars:  !0 = $needle, !1 = $replacement, !2 = $haystack, !3 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        ROPE_INIT                                     3  ~5      '%2F%5Cb'
          4        ROPE_ADD                                      1  ~5      ~5, !0
          5        ROPE_END                                      2  ~4      ~5, '%5Cb%2Fi'
          6        ASSIGN                                                   !3, ~4
    5     7        INIT_FCALL                                               'preg_replace'
          8        SEND_VAR                                                 !3
          9        SEND_VAR                                                 !1
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
    6    13      > RETURN                                                   !2
    7    14*     > RETURN                                                   null

End of function str_replace_word

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.93 ms | 1399 KiB | 17 Q