3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'YO_{ YO_{ YO_{ McDonalds. } } }';; $test = preg_replace_callback($p = '/YO_\{(.*)\}/s', $f = function($matches) use (&$f, &$p) { return preg_match($p, $matches[1]) ?trim(preg_replace_callback($p, $f, $matches[1])) :$matches[1]; }, $test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TOuhV
function name:  (null)
number of ops:  13
compiled vars:  !0 = $test, !1 = $p, !2 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'YO_%7B%0A++++YO_%7B%0A++++++++YO_%7B%0A++++++++++++McDonalds.%0A++++++++%7D%0A++++%7D%0A%7D'
   11     1        INIT_FCALL                                               'preg_replace_callback'
          2        ASSIGN                                           ~4      !1, '%2FYO_%5C%7B%28.%2A%29%5C%7D%2Fs'
          3        SEND_VAL                                                 ~4
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FTOuhV%3A11%240'
          5        BIND_LEXICAL                                             ~5, !2
          6        BIND_LEXICAL                                             ~5, !1
          7        ASSIGN                                           ~6      !2, ~5
          8        SEND_VAL                                                 ~6
   16     9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $7      
   11    11        ASSIGN                                                   !0, $7
   16    12      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FTOuhV%3A11%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TOuhV
function name:  {closure}
number of ops:  24
compiled vars:  !0 = $matches, !1 = $f, !2 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        BIND_STATIC                                              !2
   13     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAR                                                 !2
          5        FETCH_DIM_R                                      ~3      !0, 1
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->20
   14     9    >   INIT_FCALL                                               'trim'
         10        INIT_FCALL                                               'preg_replace_callback'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !1
         13        FETCH_DIM_R                                      ~5      !0, 1
         14        SEND_VAL                                                 ~5
         15        DO_ICALL                                         $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                         $7      
         18        QM_ASSIGN                                        ~8      $7
         19      > JMP                                                      ->22
   15    20    >   FETCH_DIM_R                                      ~9      !0, 1
         21        QM_ASSIGN                                        ~8      ~9
         22    > > RETURN                                                   ~8
   16    23*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FTOuhV%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.54 ms | 1392 KiB | 19 Q