3v4l.org

run code in 300+ PHP versions simultaneously
<?php function greeting() { $morning = strtotime("06:00:00"); $afternoon = strtotime("12:00:00"); $evening = strtotime("18:00:00"); $night = strtotime("24:00:00"); //$time = strtotime(date('G:i:s')); $time = strtotime(date('24:30:00')); print "----\nmorning:\n"; var_dump($morning); var_dump(date('c', $morning)); print "----\nafternoon:\n"; var_dump($afternoon); var_dump(date('c', $afternoon)); print "----\nevening:\n"; var_dump($evening); var_dump(date('c', $evening)); print "----\ntime:\n"; var_dump($time); var_dump(date('24:30:00')); var_dump(date('c', $time)); if ($time >= $morning && $time <= $afternoon) { echo "Good morning, John."; } elseif ($time >= $afternoon && $time <= $evening) { echo "Good afternoon, John."; } elseif ($time >= $evening && $time <= $night) { echo "Good evening, John"; } elseif ($time >= $night && $time <= $morning) { echo "Have trouble falling asleep, John?"; } elseif ($time <= $night && $time <= $morning) { echo "Have trouble falling asleep, John?"; } } greeting();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IMYR8
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   INIT_FCALL                                               'greeting'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function greeting:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 75, Position 2 = 77
Branch analysis from position: 75
2 jumps found. (Code = 43) Position 1 = 78, Position 2 = 80
Branch analysis from position: 78
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 80
2 jumps found. (Code = 46) Position 1 = 82, Position 2 = 84
Branch analysis from position: 82
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 87
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
Branch analysis from position: 87
2 jumps found. (Code = 46) Position 1 = 89, Position 2 = 91
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 92, Position 2 = 94
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
Branch analysis from position: 94
2 jumps found. (Code = 46) Position 1 = 96, Position 2 = 98
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 99, Position 2 = 101
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
Branch analysis from position: 101
2 jumps found. (Code = 46) Position 1 = 103, Position 2 = 105
Branch analysis from position: 103
2 jumps found. (Code = 43) Position 1 = 106, Position 2 = 107
Branch analysis from position: 106
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 107
Branch analysis from position: 105
Branch analysis from position: 98
Branch analysis from position: 91
Branch analysis from position: 84
Branch analysis from position: 77
filename:       /in/IMYR8
function name:  greeting
number of ops:  108
compiled vars:  !0 = $morning, !1 = $afternoon, !2 = $evening, !3 = $night, !4 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 '06%3A00%3A00'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAL                                                 '12%3A00%3A00'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
    6     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAL                                                 '18%3A00%3A00'
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !2, $9
    7    12        INIT_FCALL                                               'strtotime'
         13        SEND_VAL                                                 '24%3A00%3A00'
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !3, $11
    9    16        INIT_FCALL                                               'strtotime'
         17        INIT_FCALL                                               'date'
         18        SEND_VAL                                                 '24%3A30%3A00'
         19        DO_ICALL                                         $13     
         20        SEND_VAR                                                 $13
         21        DO_ICALL                                         $14     
         22        ASSIGN                                                   !4, $14
   11    23        ECHO                                                     '----%0Amorning%3A%0A'
   12    24        INIT_FCALL                                               'var_dump'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                                 
   13    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL                                               'date'
         29        SEND_VAL                                                 'c'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $17     
         32        SEND_VAR                                                 $17
         33        DO_ICALL                                                 
   15    34        ECHO                                                     '----%0Aafternoon%3A%0A'
   16    35        INIT_FCALL                                               'var_dump'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                                 
   17    38        INIT_FCALL                                               'var_dump'
         39        INIT_FCALL                                               'date'
         40        SEND_VAL                                                 'c'
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                         $20     
         43        SEND_VAR                                                 $20
         44        DO_ICALL                                                 
   19    45        ECHO                                                     '----%0Aevening%3A%0A'
   20    46        INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !2
         48        DO_ICALL                                                 
   21    49        INIT_FCALL                                               'var_dump'
         50        INIT_FCALL                                               'date'
         51        SEND_VAL                                                 'c'
         52        SEND_VAR                                                 !2
         53        DO_ICALL                                         $23     
         54        SEND_VAR                                                 $23
         55        DO_ICALL                                                 
   23    56        ECHO                                                     '----%0Atime%3A%0A'
   24    57        INIT_FCALL                                               'var_dump'
         58        SEND_VAR                                                 !4
         59        DO_ICALL                                                 
   25    60        INIT_FCALL                                               'var_dump'
         61        INIT_FCALL                                               'date'
         62        SEND_VAL                                                 '24%3A30%3A00'
         63        DO_ICALL                                         $26     
         64        SEND_VAR                                                 $26
         65        DO_ICALL                                                 
   26    66        INIT_FCALL                                               'var_dump'
         67        INIT_FCALL                                               'date'
         68        SEND_VAL                                                 'c'
         69        SEND_VAR                                                 !4
         70        DO_ICALL                                         $28     
         71        SEND_VAR                                                 $28
         72        DO_ICALL                                                 
   28    73        IS_SMALLER_OR_EQUAL                              ~30     !0, !4
         74      > JMPZ_EX                                          ~30     ~30, ->77
         75    >   IS_SMALLER_OR_EQUAL                              ~31     !4, !1
         76        BOOL                                             ~30     ~31
         77    > > JMPZ                                                     ~30, ->80
   29    78    >   ECHO                                                     'Good+morning%2C+John.'
         79      > JMP                                                      ->107
   32    80    >   IS_SMALLER_OR_EQUAL                              ~32     !1, !4
         81      > JMPZ_EX                                          ~32     ~32, ->84
         82    >   IS_SMALLER_OR_EQUAL                              ~33     !4, !2
         83        BOOL                                             ~32     ~33
         84    > > JMPZ                                                     ~32, ->87
   33    85    >   ECHO                                                     'Good+afternoon%2C+John.'
         86      > JMP                                                      ->107
   36    87    >   IS_SMALLER_OR_EQUAL                              ~34     !2, !4
         88      > JMPZ_EX                                          ~34     ~34, ->91
         89    >   IS_SMALLER_OR_EQUAL                              ~35     !4, !3
         90        BOOL                                             ~34     ~35
         91    > > JMPZ                                                     ~34, ->94
   37    92    >   ECHO                                                     'Good+evening%2C+John'
         93      > JMP                                                      ->107
   39    94    >   IS_SMALLER_OR_EQUAL                              ~36     !3, !4
         95      > JMPZ_EX                                          ~36     ~36, ->98
         96    >   IS_SMALLER_OR_EQUAL                              ~37     !4, !0
         97        BOOL                                             ~36     ~37
         98    > > JMPZ                                                     ~36, ->101
   40    99    >   ECHO                                                     'Have+trouble+falling+asleep%2C+John%3F'
        100      > JMP                                                      ->107
   42   101    >   IS_SMALLER_OR_EQUAL                              ~38     !4, !3
        102      > JMPZ_EX                                          ~38     ~38, ->105
        103    >   IS_SMALLER_OR_EQUAL                              ~39     !4, !0
        104        BOOL                                             ~38     ~39
        105    > > JMPZ                                                     ~38, ->107
   43   106    >   ECHO                                                     'Have+trouble+falling+asleep%2C+John%3F'
   46   107    > > RETURN                                                   null

End of function greeting

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.82 ms | 1407 KiB | 20 Q