3v4l.org

run code in 300+ PHP versions simultaneously
<?php $patterns = ['/\bhim\b/', '/\bhimself\b/', '/\bhe\b/', '/\bhis\b/']; $replacements = ['her', 'herself', 'she', 'her']; $str = 'he went by "himself" (his imaginary friend came with him) to the himalayas. this was not the first time in history '; echo preg_replace($patterns, $replacements, $str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JQ1nn
function name:  (null)
number of ops:  10
compiled vars:  !0 = $patterns, !1 = $replacements, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 'he+went+by+%22himself%22+%28his+imaginary+friend+came+with+him%29+to+the+himalayas.+this+was+not+the+first+time+in+history+'
    7     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $6      
          8        ECHO                                                     $6
          9      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.72 ms | 1394 KiB | 15 Q