3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt = <<<'EOD' {| test1 test2 test3 test4 test5 |} {| test6 test7 test8 test9 test10 |} EOD; echo preg_replace('~ (?: \G (?!\A) | \Q{|\E ) [^|\n]*+ (?s: (?! \Q|}\E | \n\n) . [^|\n]*)*+ \n \K \n+ ~x', '', $txt); echo PHP_EOL, '---', PHP_EOL; echo preg_replace_callback('~\Q{|\E .*? \Q|}\E~sx', function ($m) { return preg_replace('~\n+~', "\n", $m[0]); }, $txt);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PIVSS
function name:  (null)
number of ops:  18
compiled vars:  !0 = $txt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%7C+test1%0A%0Atest2%0Atest3%0A%0Atest4%0A%0Atest5%0A%7C%7D%0A%0A%7B%7C+test6%0Atest7%0A%0Atest8%0A%0Atest9%0Atest10%0A%7C%7D'
   24     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7E+%28%3F%3A+%5CG+%28%3F%21%5CA%29+%7C+%5CQ%7B%7C%5CE+%29+%5B%5E%7C%5Cn%5D%2A%2B+%28%3Fs%3A+%28%3F%21+%5CQ%7C%7D%5CE+%7C+%5Cn%5Cn%29+.+%5B%5E%7C%5Cn%5D%2A%29%2A%2B+%5Cn+%5CK+%5Cn%2B+%7Ex'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
   25     7        ECHO                                                     '%0A'
          8        ECHO                                                     '---'
          9        ECHO                                                     '%0A'
   26    10        INIT_FCALL                                               'preg_replace_callback'
         11        SEND_VAL                                                 '%7E%5CQ%7B%7C%5CE+.%2A%3F+%5CQ%7C%7D%5CE%7Esx'
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPIVSS%3A26%240'
   28    13        SEND_VAL                                                 ~3
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $4      
         16        ECHO                                                     $4
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPIVSS%3A26%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PIVSS
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
   27     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7E%5Cn%2B%7E'
          3        SEND_VAL                                                 '%0A'
          4        FETCH_DIM_R                                      ~1      !0, 0
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   28     8*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPIVSS%3A26%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.3 ms | 1401 KiB | 17 Q