3v4l.org

run code in 300+ PHP versions simultaneously
<?php function func($input) { static $count = 0; echo (++$count); return preg_replace_callback('/YO\_\{(.*?)\}/s', 'func', $input); } $input = <<<'EOD' YO_{ YO_{ YO_{ McDonalds. } } } EOD; echo func($input);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e6cBd
function name:  (null)
number of ops:  6
compiled vars:  !0 = $input
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'YO_%7B%0A++++YO_%7B%0A++++++++YO_%7B%0A++++++++++++McDonalds.%0A++++++++%7D%0A++++%7D%0A%7D'
   18     1        INIT_FCALL                                               'func'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e6cBd
function name:  func
number of ops:  11
compiled vars:  !0 = $input, !1 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        BIND_STATIC                                              !1
    4     2        PRE_INC                                          ~2      !1
          3        ECHO                                                     ~2
    5     4        INIT_FCALL                                               'preg_replace_callback'
          5        SEND_VAL                                                 '%2FYO%5C_%5C%7B%28.%2A%3F%29%5C%7D%2Fs'
          6        SEND_VAL                                                 'func'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $3      
          9      > RETURN                                                   $3
    6    10*     > RETURN                                                   null

End of function func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.89 ms | 1389 KiB | 16 Q