3v4l.org

run code in 500+ PHP versions simultaneously
<?php $s = "# (1296) {20} [529] [1496] [411]\n# (MONDAY ) (1296)\n# (646) {20} (BEACH 7) [20 Mtrs] { 03 Foot }\n# {19} [455] [721] (1296) (SUNDAY ) [2741] (MONDAY (WEDNESDAY {20}\n# {19} (1296)"; if (preg_match_all('~^#|(?:(\[)|(\()|{)\d+(?(1)]|(?(2)\)|}))~m', $s, $m)) { echo preg_replace_callback('~^(#)\s*|#\s*~', function($m) { return isset($m[1]) ? "#" : "\n#"; }, implode(" ", $m[0])); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/u8LG5
function name:  (null)
number of ops:  17
compiled vars:  !0 = $s, !1 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%23+%281296%29+%7B20%7D+%5B529%5D+%5B1496%5D+%5B411%5D%0A%23+%28MONDAY+%29+%281296%29%0A%23+%28646%29+%7B20%7D+%28BEACH+7%29+%5B20+Mtrs%5D+%7B+03+Foot+%7D%0A%23+%7B19%7D+%5B455%5D+%5B721%5D+%281296%29+%28SUNDAY+%29+%5B2741%5D+%28MONDAY+%28WEDNESDAY+%7B20%7D%0A%23+%7B19%7D+%281296%29'
    4     1        INIT_FCALL                                                   'preg_match_all'
          2        SEND_VAL                                                     '%7E%5E%23%7C%28%3F%3A%28%5C%5B%29%7C%28%5C%28%29%7C%7B%29%5Cd%2B%28%3F%281%29%5D%7C%28%3F%282%29%5C%29%7C%7D%29%29%7Em'
          3        SEND_VAR                                                     !0
          4        SEND_REF                                                     !1
          5        DO_ICALL                                             $3      
          6      > JMPZ                                                         $3, ->16
    5     7    >   INIT_FCALL                                                   'preg_replace_callback'
          8        SEND_VAL                                                     '%7E%5E%28%23%29%5Cs%2A%7C%23%5Cs%2A%7E'
          9        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
         10        SEND_VAL                                                     ~4
         11        FETCH_DIM_R                                          ~5      !1, 0
         12        FRAMELESS_ICALL_2                implode             ~6      '+', ~5
         13        SEND_VAL                                                     ~6
         14        DO_ICALL                                             $7      
         15        ECHO                                                         $7
    6    16    > > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u8LG5
function name:  {closure:/in/u8LG5:5}
number of ops:  8
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        ISSET_ISEMPTY_DIM_OBJ                             0          !0, 1
          2      > JMPZ                                                         ~1, ->5
          3    >   QM_ASSIGN                                            ~2      '%23'
          4      > JMP                                                          ->6
          5    >   QM_ASSIGN                                            ~2      '%0A%23'
          6    > > RETURN                                                       ~2
          7*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
214.05 ms | 1884 KiB | 16 Q