3v4l.org

run code in 300+ 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 = 36, Position 2 = 21
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 21
Branch analysis from position: 36
Branch analysis from position: 21
filename:       /in/5RcEZ
function name:  (null)
number of ops:  38
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    >   INIT_FCALL                                               'in_array'
         32        SEND_VAR                                                 !1
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                         $16     
         35      > JMPNZ                                                    $16, ->21
   12    36    >   ECHO                                                     !1
   13    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.06 ms | 1005 KiB | 16 Q