3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasDeadlinePast($event_id) { $event_date = '2014-07-16 17:25:24'; $event_date = new DateTime($event_date); $today = new DateTime('today'); $days = $event_date->diff($today)->d; if ($days >= 14) { return $days . ' days left' . "\n"; } return 'registration has past'; } echo hasDeadlinePast(NULL);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kueI8
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'hasdeadlinepast'
          1        SEND_VAL                                                 null
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function hasdeadlinepast:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kueI8
function name:  hasDeadlinePast
number of ops:  22
compiled vars:  !0 = $event_id, !1 = $event_date, !2 = $today, !3 = $days
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, '2014-07-16+17%3A25%3A24'
    6     2        NEW                                              $5      'DateTime'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
    7     6        NEW                                              $8      'DateTime'
          7        SEND_VAL_EX                                              'today'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !2, $8
    8    10        INIT_METHOD_CALL                                         !1, 'diff'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $11     
         13        FETCH_OBJ_R                                      ~12     $11, 'd'
         14        ASSIGN                                                   !3, ~12
   10    15        IS_SMALLER_OR_EQUAL                                      14, !3
         16      > JMPZ                                                     ~14, ->20
   11    17    >   CONCAT                                           ~15     !3, '+days+left'
         18        CONCAT                                           ~16     ~15, '%0A'
         19      > RETURN                                                   ~16
   13    20    > > RETURN                                                   'registration+has+past'
   14    21*     > RETURN                                                   null

End of function hasdeadlinepast

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.88 ms | 1399 KiB | 14 Q