3v4l.org

run code in 300+ 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:  16
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        INIT_FCALL                                               'preg_replace'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '-'
          4        SEND_VAL                                                 'Two+%2B+Two+%26+One+%2B+One+%3F'
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      $2, '%0A'
          7        ECHO                                                     ~3
    5     8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '-'
         11        SEND_VAL                                                 'Two+%2B+Two+%26amp%3B+One+%2B+One+%3F'
         12        DO_ICALL                                         $4      
         13        CONCAT                                           ~5      $4, '%0A'
         14        ECHO                                                     ~5
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.33 ms | 1009 KiB | 14 Q