3v4l.org

run code in 300+ PHP versions simultaneously
<?php $datestr = 'Fri, 28 Feb 2020 19:18:26 +010'; $date = new DateTime($datestr); $tz = preg_match('/([+-]\d+)$/', $datestr, $m) ? $m[0] : ''; $now = new DateTime(date('Y-m-d H:i:s ' . $tz)); $now->modify('-1 day'); if ($now > $date) { echo "$datestr is more than 1 day ago\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
Branch analysis from position: 32
filename:       /in/SFPW6
function name:  (null)
number of ops:  33
compiled vars:  !0 = $datestr, !1 = $date, !2 = $tz, !3 = $m, !4 = $now
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Fri%2C+28+Feb+2020+19%3A18%3A26+%2B010'
    4     1        NEW                                              $6      'DateTime'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
    5     5        INIT_FCALL                                               'preg_match'
          6        SEND_VAL                                                 '%2F%28%5B%2B-%5D%5Cd%2B%29%24%2F'
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !3
          9        DO_ICALL                                         $9      
         10      > JMPZ                                                     $9, ->14
         11    >   FETCH_DIM_R                                      ~10     !3, 0
         12        QM_ASSIGN                                        ~11     ~10
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~11     ''
         15    >   ASSIGN                                                   !2, ~11
    6    16        NEW                                              $13     'DateTime'
         17        INIT_FCALL                                               'date'
         18        CONCAT                                           ~14     'Y-m-d+H%3Ai%3As+', !2
         19        SEND_VAL                                                 ~14
         20        DO_ICALL                                         $15     
         21        SEND_VAR_NO_REF_EX                                       $15
         22        DO_FCALL                                      0          
         23        ASSIGN                                                   !4, $13
    7    24        INIT_METHOD_CALL                                         !4, 'modify'
         25        SEND_VAL_EX                                              '-1+day'
         26        DO_FCALL                                      0          
    8    27        IS_SMALLER                                               !1, !4
         28      > JMPZ                                                     ~19, ->32
    9    29    >   NOP                                                      
         30        FAST_CONCAT                                      ~20     !0, '+is+more+than+1+day+ago%0A'
         31        ECHO                                                     ~20
   10    32    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.26 ms | 1002 KiB | 15 Q