3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = 1; // Start $y = 10; // Iterations Needed $days = []; //Empty Array while($x <= $y) { // Set Buffer $buffer = 2 + $x; // Get Date with Buffer $date = date(strtotime("+$buffer days")); // If the day is a weeday if(date('N', $date) < 6){ // Add to array $days[$date] = date("l, jS M", $date); // If not, increase max iteration (example: 10 to 11) }else{ $y++; } // Go to next loop $x++; } echo "<pre>"; print_r($days);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 29
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
Branch analysis from position: 4
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
Branch analysis from position: 4
filename:       /in/0lpGX
function name:  (null)
number of ops:  38
compiled vars:  !0 = $x, !1 = $y, !2 = $days, !3 = $buffer, !4 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1
    3     1        ASSIGN                                                   !1, 10
    5     2        ASSIGN                                                   !2, <array>
    7     3      > JMP                                                      ->31
   10     4    >   ADD                                              ~8      2, !0
          5        ASSIGN                                                   !3, ~8
   12     6        INIT_FCALL                                               'date'
          7        INIT_FCALL                                               'strtotime'
          8        ROPE_INIT                                     3  ~11     '%2B'
          9        ROPE_ADD                                      1  ~11     ~11, !3
         10        ROPE_END                                      2  ~10     ~11, '+days'
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                         $13     
         13        SEND_VAR                                                 $13
         14        DO_ICALL                                         $14     
         15        ASSIGN                                                   !4, $14
   15    16        INIT_FCALL                                               'date'
         17        SEND_VAL                                                 'N'
         18        SEND_VAR                                                 !4
         19        DO_ICALL                                         $16     
         20        IS_SMALLER                                               $16, 6
         21      > JMPZ                                                     ~17, ->29
   17    22    >   INIT_FCALL                                               'date'
         23        SEND_VAL                                                 'l%2C+jS+M'
         24        SEND_VAR                                                 !4
         25        DO_ICALL                                         $19     
         26        ASSIGN_DIM                                               !2, !4
         27        OP_DATA                                                  $19
         28      > JMP                                                      ->30
   20    29    >   PRE_INC                                                  !1
   23    30    >   PRE_INC                                                  !0
    7    31    >   IS_SMALLER_OR_EQUAL                                      !0, !1
         32      > JMPNZ                                                    ~22, ->4
   26    33    >   ECHO                                                     '%3Cpre%3E'
   27    34        INIT_FCALL                                               'print_r'
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.47 ms | 1400 KiB | 19 Q