3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='"WEINSTEIN","ANTONIA \"TOBY"","STILES","HOOPER \"PETER"","HENDERSON",'; $pattern = '/(?<=\S)""/'; $replacement = '\\""'; $result=preg_replace($pattern, $replacement, $string); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/crop3
function name:  (null)
number of ops:  11
compiled vars:  !0 = $string, !1 = $pattern, !2 = $replacement, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%22WEINSTEIN%22%2C%22ANTONIA+%5C%22TOBY%22%22%2C%22STILES%22%2C%22HOOPER+%5C%22PETER%22%22%2C%22HENDERSON%22%2C'
    4     1        ASSIGN                                                   !1, '%2F%28%3F%3C%3D%5CS%29%22%22%2F'
    5     2        ASSIGN                                                   !2, '%5C%22%22'
    6     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
    7     9        ECHO                                                     !3
    8    10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.97 ms | 1009 KiB | 14 Q