3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<<STR one blah two blah foo blah three blah foo blah four blah five blah foo blah STR; $regex = "~^foo[\n]*(?:\n|$)~"; echo preg_replace($regex, '', $str, -1, $count), "\n"; echo "$count\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SKmsX
function name:  (null)
number of ops:  15
compiled vars:  !0 = $str, !1 = $regex, !2 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'one+blah%0Atwo+blah%0Afoo+blah%0Athree+blah%0Afoo+blah%0Afour+blah%0Afive+blah%0Afoo+blah'
   14     1        ASSIGN                                                   !1, '%7E%5Efoo%5B%0A%5D%2A%28%3F%3A%0A%7C%24%29%7E'
   16     2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 -1
          7        SEND_REF                                                 !2
          8        DO_ICALL                                         $5      
          9        ECHO                                                     $5
         10        ECHO                                                     '%0A'
   17    11        NOP                                                      
         12        FAST_CONCAT                                      ~6      !2, '%0A'
         13        ECHO                                                     ~6
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.27 ms | 1385 KiB | 15 Q