3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = 'My Name ## is "#P_NAM3#" and \r\n I am \'#P_AG2#\' years old `#abc#`'; $r = '#([^#]*)#'; //$r = '#(?P<name>.*?)#'; //$r = '#(\w*)#'; //preg_match_all('/'.$r.'/m', $text, $m); //var_dump($m); function trad($v) { var_dump($v); } echo preg_replace_callback('/'.$r.'/m', 'trad', $text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sNNO7
function name:  (null)
number of ops:  11
compiled vars:  !0 = $text, !1 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'My+Name+%23%23+is+%22%23P_NAM3%23%22+and+%5Cr%5Cn+I+am+%27%23P_AG2%23%27+years+old+%60%23abc%23%60'
    4     1        ASSIGN                                                   !1, '%23%28%5B%5E%23%5D%2A%29%23'
   16     2        INIT_FCALL                                               'preg_replace_callback'
          3        CONCAT                                           ~4      '%2F', !1
          4        CONCAT                                           ~5      ~4, '%2Fm'
          5        SEND_VAL                                                 ~5
          6        SEND_VAL                                                 'trad'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        ECHO                                                     $6
         10      > RETURN                                                   1

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

End of function trad

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.18 ms | 1386 KiB | 17 Q