3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "Word/Word2/The Foo/"; echo "str_replace: " . str_replace( "/The Foo/", "", $str ) . "\n"; echo "preg_replace: " . preg_replace( "+/The Foo/+", "", $str ) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mjXgE
function name:  (null)
number of ops:  12
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Word%2FWord2%2FThe+Foo%2F'
    5     1        FRAMELESS_ICALL_3                str_replace         ~2      '%2FThe+Foo%2F', ''
          2        OP_DATA                                                      !0
          3        CONCAT                                               ~3      'str_replace%3A+', ~2
          4        CONCAT                                               ~4      ~3, '%0A'
          5        ECHO                                                         ~4
    6     6        FRAMELESS_ICALL_3                preg_replace        ~5      '%2B%2FThe+Foo%2F%2B', ''
          7        OP_DATA                                                      !0
          8        CONCAT                                               ~6      'preg_replace%3A+', ~5
          9        CONCAT                                               ~7      ~6, '%0A'
         10        ECHO                                                         ~7
         11      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.96 ms | 2532 KiB | 13 Q