3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() {echo "THIS SHOULD NOT BE SEEN!!\n";} function ryat($a) {var_dump($a);} $str = "', test(), '"; echo "mb_ereg_replace()\n"; var_dump(mb_ereg_replace('^(.*)$', "ryat('\\1')", $str, 'e')); echo "\npreg_replace()\n"; var_dump(preg_replace('/^(.*)$/e', "ryat('\\1')", $str));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rcXvG
function name:  (null)
number of ops:  21
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, '%27%2C+test%28%29%2C+%27'
    8     1        ECHO                                                     'mb_ereg_replace%28%29%0A'
    9     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'mb_ereg_replace'
          4        SEND_VAL                                                 '%5E%28.%2A%29%24'
          5        SEND_VAL                                                 'ryat%28%27%5C1%27%29'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'e'
          8        DO_ICALL                                         $2      
          9        SEND_VAR                                                 $2
         10        DO_ICALL                                                 
   11    11        ECHO                                                     '%0Apreg_replace%28%29%0A'
   12    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'preg_replace'
         14        SEND_VAL                                                 '%2F%5E%28.%2A%29%24%2Fe'
         15        SEND_VAL                                                 'ryat%28%27%5C1%27%29'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $4      
         18        SEND_VAR                                                 $4
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rcXvG
function name:  test
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'THIS+SHOULD+NOT+BE+SEEN%21%21%0A'
          1      > RETURN                                                   null

End of function test

Function ryat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rcXvG
function name:  ryat
number of ops:  5
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
          4      > RETURN                                                   null

End of function ryat

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.91 ms | 1396 KiB | 19 Q