3v4l.org

run code in 500+ PHP versions simultaneously
<?php $text = 'This is (foo)((bar))'; $text = strtr($text, array('(' => '<del>', ')' => '</del>', '((' => '<ins>', '))' => '</ins>')); echo $text . "\n"; $text = 'This is (foo)((bar))'; $text = preg_replace('/(?<!\()\((?!\()([^)]*)\)/', '<del>$1</del>', $text); $text = preg_replace('/\(\(([^)]*)\)\)/', '<ins>$1</ins>', $text); echo $text . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dfvgQ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $text
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'This+is+%28foo%29%28%28bar%29%29'
    5     1        FRAMELESS_ICALL_2                strtr               ~2      !0, <array>
          2        ASSIGN                                                       !0, ~2
    6     3        CONCAT                                               ~4      !0, '%0A'
          4        ECHO                                                         ~4
    8     5        ASSIGN                                                       !0, 'This+is+%28foo%29%28%28bar%29%29'
   10     6        FRAMELESS_ICALL_3                preg_replace        ~6      '%2F%28%3F%3C%21%5C%28%29%5C%28%28%3F%21%5C%28%29%28%5B%5E%29%5D%2A%29%5C%29%2F', '%3Cdel%3E%241%3C%2Fdel%3E'
          7        OP_DATA                                                      !0
          8        ASSIGN                                                       !0, ~6
   11     9        FRAMELESS_ICALL_3                preg_replace        ~8      '%2F%5C%28%5C%28%28%5B%5E%29%5D%2A%29%5C%29%5C%29%2F', '%3Cins%3E%241%3C%2Fins%3E'
         10        OP_DATA                                                      !0
         11        ASSIGN                                                       !0, ~8
   12    12        CONCAT                                               ~10     !0, '%0A'
         13        ECHO                                                         ~10
         14      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
126.29 ms | 473 KiB | 7 Q