3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start_date = '2014-3-19'; $end_date = '2014-5-19'; $begin = new DateTime( $start_date ); $end = new DateTime(date("Y-m-d",strtotime("+1 day", strtotime($end_date)))); while($begin < $end) { $period[] = $begin->format('Y-m-d'); $begin->modify('+1 day'); } foreach($period as $val) { print_r($val . '<br>'); print_r(isWeekend($val) . '<br>'); } function isWeekend($date) { return (date('N', strtotime($date)) >= 6); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 22
Branch analysis from position: 32
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 46
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 46
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 46
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 22
Branch analysis from position: 32
Branch analysis from position: 22
filename:       /in/DrL5h
function name:  (null)
number of ops:  48
compiled vars:  !0 = $start_date, !1 = $end_date, !2 = $begin, !3 = $end, !4 = $period, !5 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2014-3-19'
    4     1        ASSIGN                                                   !1, '2014-5-19'
    6     2        NEW                                              $8      'DateTime'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $8
    7     6        NEW                                              $11     'DateTime'
          7        INIT_FCALL                                               'date'
          8        SEND_VAL                                                 'Y-m-d'
          9        INIT_FCALL                                               'strtotime'
         10        SEND_VAL                                                 '%2B1+day'
         11        INIT_FCALL                                               'strtotime'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $12     
         14        SEND_VAR                                                 $12
         15        DO_ICALL                                         $13     
         16        SEND_VAR                                                 $13
         17        DO_ICALL                                         $14     
         18        SEND_VAR_NO_REF_EX                                       $14
         19        DO_FCALL                                      0          
         20        ASSIGN                                                   !3, $11
    8    21      > JMP                                                      ->30
    9    22    >   INIT_METHOD_CALL                                         !2, 'format'
         23        SEND_VAL_EX                                              'Y-m-d'
         24        DO_FCALL                                      0  $18     
         25        ASSIGN_DIM                                               !4
         26        OP_DATA                                                  $18
   10    27        INIT_METHOD_CALL                                         !2, 'modify'
         28        SEND_VAL_EX                                              '%2B1+day'
         29        DO_FCALL                                      0          
    8    30    >   IS_SMALLER                                               !2, !3
         31      > JMPNZ                                                    ~20, ->22
   13    32    > > FE_RESET_R                                       $21     !4, ->46
         33    > > FE_FETCH_R                                               $21, !5, ->46
   14    34    >   INIT_FCALL                                               'print_r'
         35        CONCAT                                           ~22     !5, '%3Cbr%3E'
         36        SEND_VAL                                                 ~22
         37        DO_ICALL                                                 
   15    38        INIT_FCALL                                               'print_r'
         39        INIT_FCALL_BY_NAME                                       'isWeekend'
         40        SEND_VAR_EX                                              !5
         41        DO_FCALL                                      0  $24     
         42        CONCAT                                           ~25     $24, '%3Cbr%3E'
         43        SEND_VAL                                                 ~25
         44        DO_ICALL                                                 
   13    45      > JMP                                                      ->33
         46    >   FE_FREE                                                  $21
   20    47      > RETURN                                                   1

Function isweekend:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DrL5h
function name:  isWeekend
number of ops:  11
compiled vars:  !0 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'date'
          2        SEND_VAL                                                 'N'
          3        INIT_FCALL                                               'strtotime'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8        IS_SMALLER_OR_EQUAL                              ~3      6, $2
          9      > RETURN                                                   ~3
   20    10*     > RETURN                                                   null

End of function isweekend

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.72 ms | 1392 KiB | 19 Q