3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/^(?:\d+\n)?.*\h+-->\h+[0-5]{2}:.*$/m'; $str = '1 00:00:04,019 --> 00:00:07,299 line1 line2 2 00:00:07,414 --> 00:00:09,155 line1 00:00:09,276 --> 00:00:11,429 line1 00:00:11,549 --> 00:00:14,874 line1 line2 '; preg_match_all($re, $str, $matches); $matches = array_map("trim" , $matches[0]); print_r($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eeE28
function name:  (null)
number of ops:  17
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%2F%5E%28%3F%3A%5Cd%2B%5Cn%29%3F.%2A%5Ch%2B--%3E%5Ch%2B%5B0-5%5D%7B2%7D%3A.%2A%24%2Fm'
    4     1        ASSIGN                                                       !1, '1%0A00%3A00%3A04%2C019+--%3E+00%3A00%3A07%2C299%0Aline1%0Aline2%0A%0A2%0A00%3A00%3A07%2C414+--%3E+00%3A00%3A09%2C155%0Aline1%0A%0A00%3A00%3A09%2C276+--%3E+00%3A00%3A11%2C429%0Aline1%0A%0A00%3A00%3A11%2C549+--%3E+00%3A00%3A14%2C874%0Aline1%0Aline2%0A'
   21     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        SEND_REF                                                     !2
          6        DO_ICALL                                                     
   22     7        INIT_FCALL                                                   'array_map'
          8        SEND_VAL                                                     'trim'
          9        FETCH_DIM_R                                          ~6      !2, 0
         10        SEND_VAL                                                     ~6
         11        DO_ICALL                                             $7      
         12        ASSIGN                                                       !2, $7
   23    13        INIT_FCALL                                                   'print_r'
         14        SEND_VAR                                                     !2
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
131.97 ms | 2102 KiB | 16 Q