3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fix_strtotime($date) { if(preg_match('/([012]?[0-9]?:[0-5]{1}\d\s*[aA|pP]?[mM]?)(\s+)(.+)/', $date, $matches)) { return strtotime($matches[3] . $matches[2] . $matches[1]); } return strtotime($date); } echo fix_strtotime('-2 days 04:00'); // 2010-09-17 14:00:00
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/caHDJ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'fix_strtotime'
          1        SEND_VAL                                                 '-2+days+04%3A00'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function fix_strtotime:
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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/caHDJ
function name:  fix_strtotime
number of ops:  21
compiled vars:  !0 = $date, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%28%5B012%5D%3F%5B0-9%5D%3F%3A%5B0-5%5D%7B1%7D%5Cd%5Cs%2A%5BaA%7CpP%5D%3F%5BmM%5D%3F%29%28%5Cs%2B%29%28.%2B%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->16
    7     7    >   INIT_FCALL                                               'strtotime'
          8        FETCH_DIM_R                                      ~3      !1, 3
          9        FETCH_DIM_R                                      ~4      !1, 2
         10        CONCAT                                           ~5      ~3, ~4
         11        FETCH_DIM_R                                      ~6      !1, 1
         12        CONCAT                                           ~7      ~5, ~6
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15      > RETURN                                                   $8
    9    16    >   INIT_FCALL                                               'strtotime'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $9      
         19      > RETURN                                                   $9
   10    20*     > RETURN                                                   null

End of function fix_strtotime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.17 ms | 1398 KiB | 18 Q