3v4l.org

run code in 500+ PHP versions simultaneously
<?php $timeString = "4:29:16"; echo preg_replace_callback( '~:\K(\d{2}).*~', fn($m) => $m[1] - $m[1] % 15 . ':00', $timeString ); echo "\n---\n"; echo preg_replace_callback( '~:\K(\d{2}).*~', function($m) {return $m[1] - $m[1] % 15 . ':00';}, $timeString );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qh3LY
function name:  (null)
number of ops:  17
compiled vars:  !0 = $timeString
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '4%3A29%3A16'
    4     1        INIT_FCALL                                                   'preg_replace_callback'
    5     2        SEND_VAL                                                     '%7E%3A%5CK%28%5Cd%7B2%7D%29.%2A%7E'
    6     3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
          4        SEND_VAL                                                     ~2
    7     5        SEND_VAR                                                     !0
    4     6        DO_ICALL                                             $3      
    7     7        ECHO                                                         $3
   10     8        ECHO                                                         '%0A---%0A'
   11     9        INIT_FCALL                                                   'preg_replace_callback'
   12    10        SEND_VAL                                                     '%7E%3A%5CK%28%5Cd%7B2%7D%29.%2A%7E'
   13    11        DECLARE_LAMBDA_FUNCTION                              ~4      [1]
         12        SEND_VAL                                                     ~4
   14    13        SEND_VAR                                                     !0
   11    14        DO_ICALL                                             $5      
   14    15        ECHO                                                         $5
   15    16      > 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/Qh3LY
function name:  {closure:/in/Qh3LY:6}
number of ops:  8
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        FETCH_DIM_R                                          ~1      !0, 1
          2        FETCH_DIM_R                                          ~2      !0, 1
          3        MOD                                                  ~3      ~2, 15
          4        SUB                                                  ~4      ~1, ~3
          5        CONCAT                                               ~5      ~4, '%3A00'
          6      > RETURN                                                       ~5
          7*     > RETURN                                                       null

End of Dynamic Function 0

Dynamic Function 1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Qh3LY
function name:  {closure:/in/Qh3LY:13}
number of ops:  8
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   RECV                                                 !0      
          1        FETCH_DIM_R                                          ~1      !0, 1
          2        FETCH_DIM_R                                          ~2      !0, 1
          3        MOD                                                  ~3      ~2, 15
          4        SUB                                                  ~4      ~1, ~3
          5        CONCAT                                               ~5      ~4, '%3A00'
          6      > RETURN                                                       ~5
          7*     > RETURN                                                       null

End of Dynamic Function 1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
174.11 ms | 2102 KiB | 14 Q