3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = '<!--TAG_INI-->' . str_repeat("a\n", 50000) . '<!--TAG_END-->'; $pattern = "/<!--TAG_INI-->.*?<!--TAG_END-->/s"; $content = preg_replace($pattern, 'foo', $content); var_dump(strlen($content));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UUFM6
function name:  (null)
number of ops:  19
compiled vars:  !0 = $content, !1 = $pattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'str_repeat'
          1        SEND_VAL                                                 'a%0A'
          2        SEND_VAL                                                 50000
          3        DO_ICALL                                         $2      
          4        CONCAT                                           ~3      '%3C%21--TAG_INI--%3E', $2
          5        CONCAT                                           ~4      ~3, '%3C%21--TAG_END--%3E'
          6        ASSIGN                                                   !0, ~4
    4     7        ASSIGN                                                   !1, '%2F%3C%21--TAG_INI--%3E.%2A%3F%3C%21--TAG_END--%3E%2Fs'
    5     8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 'foo'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !0, $7
    6    14        INIT_FCALL                                               'var_dump'
         15        STRLEN                                           ~9      !0
         16        SEND_VAL                                                 ~9
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.72 ms | 940 KiB | 20 Q