3v4l.org

run code in 300+ PHP versions simultaneously
<?php ////DISPLAY DATE OF NEXT COUNCIL MEETING//// $now = date('U'); //get current time $firstTues = strtotime("-1 month first Tuesday 4pm"); //get first Tuesday of the month $secondTues = strtotime("-1 month second Tuesday 5pm"); //get second Tuesday of the month $fourthTues = strtotime("-1 month fourth Tuesday 5pm"); //get forth Tuesday of the month $nextTues = strtotime("first Tuesday 4pm"); //get first Tuesday of next month function nextCouncilMeeting() { //If todays date less than 1st Tuesday at 11pm, display date for 1st Tuesday 4pm. if ($now < $firstTues) { echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $firstTues); } //If todays date greater than 1st Tuesday 5pm and less than 2nd Tuesday 11pm, display date for 2nd Tuesday 5pm elseif ($now > $firstTues and $now < $secondTues) { echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $secondTues); } //If todays date greater than 2nd Tuesday 5pm and less that 4th Tuesday 11pm, display date for 4th Tuesday 5pm elseif ($now > $secondTues and $now < $fourthTues) { echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $fourthTues); } //If todays date greater than 4th Tuesday elseif ($now > $fourthTues){ echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A', $nextTues); } else{ echo "foobar"; } } ?> <!DOCTYPE html> <html> <head> </head> <body> <p id="test"> Current Time: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$now); echo " " . $now;?></br> First Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$firstTues);echo " " . $firstTues;?></br> Second Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$secondTues);echo " " . $secondTues;?></br> Fourth Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$fourthTues);echo " " . $fourthTues;?></br> Next Month First Tuesday: <?php echo date('F j\<\s\u\p\>S\</\s\u\p\> \a\t g:i A',$nextTues);echo " " . $nextTues;?> </p> <h2>Next Council Meeting:</h2> <h1><?php nextCouncilMeeting()?></h1> </body> </html>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pkDRc
function name:  (null)
number of ops:  65
compiled vars:  !0 = $now, !1 = $firstTues, !2 = $secondTues, !3 = $fourthTues, !4 = $nextTues
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'U'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAL                                                 '-1+month+first+Tuesday+4pm'
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
    6     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAL                                                 '-1+month+second+Tuesday+5pm'
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !2, $9
    7    12        INIT_FCALL                                               'strtotime'
         13        SEND_VAL                                                 '-1+month+fourth+Tuesday+5pm'
         14        DO_ICALL                                         $11     
         15        ASSIGN                                                   !3, $11
    8    16        INIT_FCALL                                               'strtotime'
         17        SEND_VAL                                                 'first+Tuesday+4pm'
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !4, $13
   36    20        ECHO                                                     '%3C%21DOCTYPE+html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%3Cp+id%3D%22test%22%3E%0ACurrent+Time%3A+'
   42    21        INIT_FCALL                                               'date'
         22        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $15     
         25        ECHO                                                     $15
         26        CONCAT                                           ~16     '+', !0
         27        ECHO                                                     ~16
         28        ECHO                                                     '%3C%2Fbr%3E%0AFirst+Tuesday%3A+'
   43    29        INIT_FCALL                                               'date'
         30        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         31        SEND_VAR                                                 !1
         32        DO_ICALL                                         $17     
         33        ECHO                                                     $17
         34        CONCAT                                           ~18     '+', !1
         35        ECHO                                                     ~18
         36        ECHO                                                     '%3C%2Fbr%3E%0ASecond+Tuesday%3A+'
   44    37        INIT_FCALL                                               'date'
         38        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                         $19     
         41        ECHO                                                     $19
         42        CONCAT                                           ~20     '+', !2
         43        ECHO                                                     ~20
         44        ECHO                                                     '%3C%2Fbr%3E%0AFourth+Tuesday%3A+'
   45    45        INIT_FCALL                                               'date'
         46        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         47        SEND_VAR                                                 !3
         48        DO_ICALL                                         $21     
         49        ECHO                                                     $21
         50        CONCAT                                           ~22     '+', !3
         51        ECHO                                                     ~22
         52        ECHO                                                     '%3C%2Fbr%3E%0ANext+Month+First+Tuesday%3A+'
   46    53        INIT_FCALL                                               'date'
         54        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         55        SEND_VAR                                                 !4
         56        DO_ICALL                                         $23     
         57        ECHO                                                     $23
         58        CONCAT                                           ~24     '+', !4
         59        ECHO                                                     ~24
   47    60        ECHO                                                     '%3C%2Fp%3E%0A%3Ch2%3ENext+Council+Meeting%3A%3C%2Fh2%3E%0A%3Ch1%3E'
   49    61        INIT_FCALL                                               'nextcouncilmeeting'
         62        DO_FCALL                                      0          
         63        ECHO                                                     '%3C%2Fh1%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   51    64      > RETURN                                                   1

Function nextcouncilmeeting:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 8
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 46) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 19
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 30
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 38
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 12
filename:       /in/pkDRc
function name:  nextCouncilMeeting
number of ops:  40
compiled vars:  !0 = $now, !1 = $firstTues, !2 = $secondTues, !3 = $fourthTues, !4 = $nextTues
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   IS_SMALLER                                               !0, !1
          1      > JMPZ                                                     ~5, ->8
   14     2    >   INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ECHO                                                     $6
          7      > JMP                                                      ->39
   18     8    >   IS_SMALLER                                       ~7      !1, !0
          9      > JMPZ_EX                                          ~7      ~7, ->12
         10    >   IS_SMALLER                                       ~8      !0, !2
         11        BOOL                                             ~7      ~8
         12    > > JMPZ                                                     ~7, ->19
   19    13    >   INIT_FCALL                                               'date'
         14        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $9      
         17        ECHO                                                     $9
         18      > JMP                                                      ->39
   23    19    >   IS_SMALLER                                       ~10     !2, !0
         20      > JMPZ_EX                                          ~10     ~10, ->23
         21    >   IS_SMALLER                                       ~11     !0, !3
         22        BOOL                                             ~10     ~11
         23    > > JMPZ                                                     ~10, ->30
   24    24    >   INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $12     
         28        ECHO                                                     $12
         29      > JMP                                                      ->39
   28    30    >   IS_SMALLER                                               !3, !0
         31      > JMPZ                                                     ~13, ->38
   29    32    >   INIT_FCALL                                               'date'
         33        SEND_VAL                                                 'F+j%5C%3C%5Cs%5Cu%5Cp%5C%3ES%5C%3C%2F%5Cs%5Cu%5Cp%5C%3E+%5Ca%5Ct+g%3Ai+A'
         34        SEND_VAR                                                 !4
         35        DO_ICALL                                         $14     
         36        ECHO                                                     $14
         37      > JMP                                                      ->39
   32    38    >   ECHO                                                     'foobar'
   34    39    > > RETURN                                                   null

End of function nextcouncilmeeting

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.21 ms | 1411 KiB | 18 Q