3v4l.org

run code in 500+ PHP versions simultaneously
<?php $regex = '#\&(amp;)?#'; echo preg_replace($regex, '-', 'Two + Two & One + One ?') . "\n"; echo preg_replace($regex, '-', 'Two + Two &amp; One + One ?') . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s1tVW
function name:  (null)
number of ops:  10
compiled vars:  !0 = $regex
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%23%5C%26%28amp%3B%29%3F%23'
    4     1        FRAMELESS_ICALL_3                preg_replace        ~2      !0, '-'
          2        OP_DATA                                                      'Two+%2B+Two+%26+One+%2B+One+%3F'
          3        CONCAT                                               ~3      ~2, '%0A'
          4        ECHO                                                         ~3
    5     5        FRAMELESS_ICALL_3                preg_replace        ~4      !0, '-'
          6        OP_DATA                                                      'Two+%2B+Two+%26amp%3B+One+%2B+One+%3F'
          7        CONCAT                                               ~5      ~4, '%0A'
          8        ECHO                                                         ~5
          9      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.51 ms | 2060 KiB | 13 Q