3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = [ '1:10.10', '1.5.07', '0.3', '00:13,40', '15,17', ]; var_export( preg_replace_callback( '~(?:(\d{1,2})[:.,](?!\d+$))?(?:(\d{1,2})[:.,])?(\d{1,2})$~', function($m) { return sprintf('%02d:%02d.%02d', $m[1], $m[2], $m[3]); }, $tests ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4tQqY
function name:  (null)
number of ops:  11
compiled vars:  !0 = $tests
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'var_export'
   12     2        INIT_FCALL                                               'preg_replace_callback'
   13     3        SEND_VAL                                                 '%7E%28%3F%3A%28%5Cd%7B1%2C2%7D%29%5B%3A.%2C%5D%28%3F%21%5Cd%2B%24%29%29%3F%28%3F%3A%28%5Cd%7B1%2C2%7D%29%5B%3A.%2C%5D%29%3F%28%5Cd%7B1%2C2%7D%29%24%7E'
   14     4        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   16     5        SEND_VAL                                                 ~2
   17     6        SEND_VAR                                                 !0
   12     7        DO_ICALL                                         $3      
   17     8        SEND_VAR                                                 $3
   11     9        DO_ICALL                                                 
   19    10      > 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/4tQqY
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%2502d%3A%2502d.%2502d'
          3        FETCH_DIM_R                                      ~1      !0, 1
          4        SEND_VAL                                                 ~1
          5        FETCH_DIM_R                                      ~2      !0, 2
          6        SEND_VAL                                                 ~2
          7        FETCH_DIM_R                                      ~3      !0, 3
          8        SEND_VAL                                                 ~3
          9        DO_ICALL                                         $4      
         10      > RETURN                                                   $4
   16    11*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.54 ms | 1015 KiB | 16 Q