3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<STR ... rule one, two, three, /* comment1 comment1.1 */ four, five, /*comment2*/ six end STR; echo preg_replace_callback( '~rule(.*?)end~s', function ($match) { return preg_replace('~/\*.*?\*/~s', '', $match[1]); }, $str );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MnIrd
function name:  (null)
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '...%0Arule%0Aone%2C+two%2C+three%2C%0A%2F%2A+comment1+%0Acomment1.1+%2A%2F%0A%0Afour%2C+five%2C%0A%2F%2Acomment2%2A%2F%0A%0Asix%0Aend'
   16     1        INIT_FCALL                                               'preg_replace_callback'
   17     2        SEND_VAL                                                 '%7Erule%28.%2A%3F%29end%7Es'
   18     3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FMnIrd%3A18%240'
   20     4        SEND_VAL                                                 ~2
   21     5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $3      
          7        ECHO                                                     $3
   22     8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FMnIrd%3A18%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MnIrd
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7E%2F%5C%2A.%2A%3F%5C%2A%2F%7Es'
          3        SEND_VAL                                                 ''
          4        FETCH_DIM_R                                      ~1      !0, 1
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   20     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FMnIrd%3A18%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.89 ms | 1395 KiB | 17 Q