3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA 14/12/2020 12:02:50 LOG_HERE_1 XXXXX 14/12/2020 12:04:55 LOG_HERE_2 XXXXX 14/12/2020 12:10:33 LOG_HERE_3 XXXXX DATA; $pattern = "~^(\d{2}/\d{2}/\d{4}\b.*\R(?:(?!\d{2}/\d{2}/\d{4}\b).*\R?)*)~m"; $result = array_map(function($x){ return preg_replace("/\R+/", " ", $x); }, preg_split($pattern, $data, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY)); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fllBO
function name:  (null)
number of ops:  18
compiled vars:  !0 = $data, !1 = $pattern, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '14%2F12%2F2020+12%3A02%3A50%0ALOG_HERE_1+XXXXX%0A%0A14%2F12%2F2020+12%3A04%3A55%0ALOG_HERE_2+XXXXX%0A%0A14%2F12%2F2020+12%3A10%3A33%0ALOG_HERE_3+XXXXX'
   14     1        ASSIGN                                                   !1, '%7E%5E%28%5Cd%7B2%7D%2F%5Cd%7B2%7D%2F%5Cd%7B4%7D%5Cb.%2A%5CR%28%3F%3A%28%3F%21%5Cd%7B2%7D%2F%5Cd%7B2%7D%2F%5Cd%7B4%7D%5Cb%29.%2A%5CR%3F%29%2A%29%7Em'
   15     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
   17     4        SEND_VAL                                                 ~5
          5        INIT_FCALL                                               'preg_split'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 -1
          9        SEND_VAL                                                 3
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
   15    12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
   18    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                                 
         17      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fllBO
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5CR%2B%2F'
          3        SEND_VAL                                                 '+'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
   17     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.3 ms | 1015 KiB | 17 Q