3v4l.org

run code in 500+ PHP versions simultaneously
<?php $outOfStock = true; echo date('d-m-Y') , "\n"; // as baseline $deliveryDate = date('d-m-Y', strtotime('+' . 1+$outOfStock . ' day')); // treat bool as int: instock=1, outofstock=2 echo $deliveryDate , "\n"; // as proof $allHolidays = array('17-05-2018', '18-05-2018', '19-05-2018'); while(in_array($deliveryDate,$allHolidays)){ $deliveryDate = date('d-m-Y', strtotime("$deliveryDate +1 day")); } echo $deliveryDate;
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 = 21
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 21
Branch analysis from position: 33
Branch analysis from position: 21
filename:       /in/5RcEZ
function name:  (null)
number of ops:  35
compiled vars:  !0 = $outOfStock, !1 = $deliveryDate, !2 = $allHolidays
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <true>
    3     1        INIT_FCALL                                                   'date'
          2        SEND_VAL                                                     'd-m-Y'
          3        DO_ICALL                                             $4      
          4        ECHO                                                         $4
          5        ECHO                                                         '%0A'
    5     6        INIT_FCALL                                                   'date'
          7        SEND_VAL                                                     'd-m-Y'
          8        INIT_FCALL                                                   'strtotime'
          9        ADD                                                  ~5      1, !0
         10        CONCAT                                               ~6      '%2B', ~5
         11        CONCAT                                               ~7      ~6, '+day'
         12        SEND_VAL                                                     ~7
         13        DO_ICALL                                             $8      
         14        SEND_VAR                                                     $8
         15        DO_ICALL                                             $9      
         16        ASSIGN                                                       !1, $9
    6    17        ECHO                                                         !1
         18        ECHO                                                         '%0A'
    8    19        ASSIGN                                                       !2, <array>
    9    20      > JMP                                                          ->31
   10    21    >   INIT_FCALL                                                   'date'
         22        SEND_VAL                                                     'd-m-Y'
         23        INIT_FCALL                                                   'strtotime'
         24        NOP                                                          
         25        FAST_CONCAT                                          ~12     !1, '+%2B1+day'
         26        SEND_VAL                                                     ~12
         27        DO_ICALL                                             $13     
         28        SEND_VAR                                                     $13
         29        DO_ICALL                                             $14     
         30        ASSIGN                                                       !1, $14
    9    31    >   FRAMELESS_ICALL_2                in_array            ~16     !1, !2
         32      > JMPNZ                                                        ~16, ->21
   12    33    >   ECHO                                                         !1
   13    34      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.91 ms | 2144 KiB | 15 Q