3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasDeadlinePast($event_id) { $event_date = '2014-06-04'; $event_date = new DateTime($event_date); $today = new DateTime('today'); // $days = $event_date->diff($today)->d; $days = $event_date->diff($today)->format('%R%a days'); echo $days; 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/8ch46
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     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 = 20, Position 2 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/8ch46
function name:  hasDeadlinePast
number of ops:  21
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-06-04'
    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
    9    10        INIT_METHOD_CALL                                         !1, 'diff'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $11     
         13        INIT_METHOD_CALL                                         $11, 'format'
         14        SEND_VAL_EX                                              '%25R%25a+days'
         15        DO_FCALL                                      0  $12     
         16        ASSIGN                                                   !3, $12
   10    17        ECHO                                                     !3
   12    18        IS_SMALLER_OR_EQUAL                                      14, !3
         19      > JMPZ                                                     ~14, ->20
   16    20    > > RETURN                                                   null

End of function hasdeadlinepast

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.38 ms | 1390 KiB | 14 Q