3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isDateValid(DateTime $checkDate, DateTime $startDate, DateTime $endDate) { return ($checkDate > $startDate && $checkDate < $endDate) ? true : false; } $checkDate = new DateTime("2016-06-15"); $startDate = new DateTime("2016-06-10 12:00"); $endDate = new DateTime("2016-06-20 12:00"); $isDateValid = isDateValid($checkDate, $startDate, $endDate); if($isDateValid){ echo "Valid"; }else{ echo "Invalid"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dSUcP
function name:  (null)
number of ops:  23
compiled vars:  !0 = $checkDate, !1 = $startDate, !2 = $endDate, !3 = $isDateValid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $4      'DateTime'
          1        SEND_VAL_EX                                              '2016-06-15'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    8     4        NEW                                              $7      'DateTime'
          5        SEND_VAL_EX                                              '2016-06-10+12%3A00'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
    9     8        NEW                                              $10     'DateTime'
          9        SEND_VAL_EX                                              '2016-06-20+12%3A00'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !2, $10
   11    12        INIT_FCALL                                               'isdatevalid'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !2
         16        DO_FCALL                                      0  $13     
         17        ASSIGN                                                   !3, $13
   12    18      > JMPZ                                                     !3, ->21
   13    19    >   ECHO                                                     'Valid'
   12    20      > JMP                                                      ->22
   15    21    >   ECHO                                                     'Invalid'
   16    22    > > RETURN                                                   1

Function isdatevalid:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
filename:       /in/dSUcP
function name:  isDateValid
number of ops:  13
compiled vars:  !0 = $checkDate, !1 = $startDate, !2 = $endDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    4     3        IS_SMALLER                                       ~3      !1, !0
          4      > JMPZ_EX                                          ~3      ~3, ->7
          5    >   IS_SMALLER                                       ~4      !0, !2
          6        BOOL                                             ~3      ~4
          7    > > JMPZ                                                     ~3, ->10
          8    >   QM_ASSIGN                                        ~5      <true>
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~5      <false>
         11    > > RETURN                                                   ~5
    5    12*     > RETURN                                                   null

End of function isdatevalid

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.18 ms | 1008 KiB | 14 Q