3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.74 ms | 1000 KiB | 15 Q