3v4l.org

run code in 300+ PHP versions simultaneously
<?php $w = date("w"); $morning = (date("H") < 9 || (date("H") == 9 && date("i") <= 15)) ? true : false; if ($w == 4) { $addDays = ($morning) ? 0 : 1; } else if ($w == 5) { $addDays = ($morning) ? 1 : 2; } else if ($w == 6) { $addDays = 3; } else if ($w == 0) { $addDays = 2; } else { $addDays = ($morning) ? 1 : 2; } $interval = DateInterval::createfromdatestring('+' . $addDays . ' day'); $_hebeproductionDeliveryDateCompare->add($interval); $response = $webshop->getSettings(); $settings = ($response['status'] == 'ok') ? $response['records'] : array(); if (isset($settings['next_pre_order_date']) && $settings['next_pre_order_date']) { $settingDate = new DateTime($settings['next_pre_order_date']); $_hebeproductionDeliveryDateCompare = new DateTime(date("Y-m-d") . " 08:00:00"); $_hebeproductionDeliveryDateCompare->modify('+' . $addDays . ' days'); if ($settingDate > $_hebeproductionDeliveryDateCompare) { $_hebeproductionDeliveryDateCompare = $settingDate; } } var_dump($w); var_dump($morning); var_dump($addDays);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 20
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 33
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 72
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
2 jumps found. (Code = 46) Position 1 = 76, Position 2 = 78
Branch analysis from position: 76
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 101
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 101
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 101
Branch analysis from position: 101
Branch analysis from position: 78
Branch analysis from position: 72
2 jumps found. (Code = 46) Position 1 = 76, Position 2 = 78
Branch analysis from position: 76
Branch analysis from position: 78
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 41
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 38
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 54
Branch analysis from position: 54
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 72
Branch analysis from position: 69
Branch analysis from position: 72
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 72
Branch analysis from position: 69
Branch analysis from position: 72
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 33
Branch analysis from position: 27
Branch analysis from position: 33
Branch analysis from position: 19
Branch analysis from position: 20
filename:       /in/Lh3mZ
function name:  (null)
number of ops:  111
compiled vars:  !0 = $w, !1 = $morning, !2 = $addDays, !3 = $interval, !4 = $_hebeproductionDeliveryDateCompare, !5 = $response, !6 = $webshop, !7 = $settings, !8 = $settingDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date'
          1        SEND_VAL                                                 'w'
          2        DO_ICALL                                         $9      
          3        ASSIGN                                                   !0, $9
    4     4        INIT_FCALL                                               'date'
          5        SEND_VAL                                                 'H'
          6        DO_ICALL                                         $11     
          7        IS_SMALLER                                       ~12     $11, 9
          8      > JMPNZ_EX                                         ~12     ~12, ->20
          9    >   INIT_FCALL                                               'date'
         10        SEND_VAL                                                 'H'
         11        DO_ICALL                                         $13     
         12        IS_EQUAL                                         ~14     $13, 9
         13      > JMPZ_EX                                          ~14     ~14, ->19
         14    >   INIT_FCALL                                               'date'
         15        SEND_VAL                                                 'i'
         16        DO_ICALL                                         $15     
         17        IS_SMALLER_OR_EQUAL                              ~16     $15, 15
         18        BOOL                                             ~14     ~16
         19    >   BOOL                                             ~12     ~14
         20    > > JMPZ                                                     ~12, ->23
         21    >   QM_ASSIGN                                        ~17     <true>
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~17     <false>
         24    >   ASSIGN                                                   !1, ~17
    7    25        IS_EQUAL                                                 !0, 4
         26      > JMPZ                                                     ~19, ->33
    8    27    > > JMPZ                                                     !1, ->30
         28    >   QM_ASSIGN                                        ~20     0
         29      > JMP                                                      ->31
         30    >   QM_ASSIGN                                        ~20     1
         31    >   ASSIGN                                                   !2, ~20
         32      > JMP                                                      ->54
    9    33    >   IS_EQUAL                                                 !0, 5
         34      > JMPZ                                                     ~22, ->41
   10    35    > > JMPZ                                                     !1, ->38
         36    >   QM_ASSIGN                                        ~23     1
         37      > JMP                                                      ->39
         38    >   QM_ASSIGN                                        ~23     2
         39    >   ASSIGN                                                   !2, ~23
         40      > JMP                                                      ->54
   11    41    >   IS_EQUAL                                                 !0, 6
         42      > JMPZ                                                     ~25, ->45
   12    43    >   ASSIGN                                                   !2, 3
         44      > JMP                                                      ->54
   13    45    >   IS_EQUAL                                                 !0, 0
         46      > JMPZ                                                     ~27, ->49
   14    47    >   ASSIGN                                                   !2, 2
         48      > JMP                                                      ->54
   16    49    > > JMPZ                                                     !1, ->52
         50    >   QM_ASSIGN                                        ~29     1
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~29     2
         53    >   ASSIGN                                                   !2, ~29
   19    54    >   INIT_STATIC_METHOD_CALL                                  'DateInterval', 'createfromdatestring'
         55        CONCAT                                           ~31     '%2B', !2
         56        CONCAT                                           ~32     ~31, '+day'
         57        SEND_VAL                                                 ~32
         58        DO_FCALL                                      0  $33     
         59        ASSIGN                                                   !3, $33
   20    60        INIT_METHOD_CALL                                         !4, 'add'
         61        SEND_VAR_EX                                              !3
         62        DO_FCALL                                      0          
   22    63        INIT_METHOD_CALL                                         !6, 'getSettings'
         64        DO_FCALL                                      0  $36     
         65        ASSIGN                                                   !5, $36
   23    66        FETCH_DIM_R                                      ~38     !5, 'status'
         67        IS_EQUAL                                                 ~38, 'ok'
         68      > JMPZ                                                     ~39, ->72
         69    >   FETCH_DIM_R                                      ~40     !5, 'records'
         70        QM_ASSIGN                                        ~41     ~40
         71      > JMP                                                      ->73
         72    >   QM_ASSIGN                                        ~41     <array>
         73    >   ASSIGN                                                   !7, ~41
   24    74        ISSET_ISEMPTY_DIM_OBJ                         0  ~43     !7, 'next_pre_order_date'
         75      > JMPZ_EX                                          ~43     ~43, ->78
         76    >   FETCH_DIM_R                                      ~44     !7, 'next_pre_order_date'
         77        BOOL                                             ~43     ~44
         78    > > JMPZ                                                     ~43, ->101
   25    79    >   NEW                                              $45     'DateTime'
         80        CHECK_FUNC_ARG                                           
         81        FETCH_DIM_FUNC_ARG                               $46     !7, 'next_pre_order_date'
         82        SEND_FUNC_ARG                                            $46
         83        DO_FCALL                                      0          
         84        ASSIGN                                                   !8, $45
   26    85        NEW                                              $49     'DateTime'
         86        INIT_FCALL                                               'date'
         87        SEND_VAL                                                 'Y-m-d'
         88        DO_ICALL                                         $50     
         89        CONCAT                                           ~51     $50, '+08%3A00%3A00'
         90        SEND_VAL_EX                                              ~51
         91        DO_FCALL                                      0          
         92        ASSIGN                                                   !4, $49
   27    93        INIT_METHOD_CALL                                         !4, 'modify'
         94        CONCAT                                           ~54     '%2B', !2
         95        CONCAT                                           ~55     ~54, '+days'
         96        SEND_VAL_EX                                              ~55
         97        DO_FCALL                                      0          
   29    98        IS_SMALLER                                               !4, !8
         99      > JMPZ                                                     ~57, ->101
   30   100    >   ASSIGN                                                   !4, !8
   33   101    >   INIT_FCALL                                               'var_dump'
        102        SEND_VAR                                                 !0
        103        DO_ICALL                                                 
   34   104        INIT_FCALL                                               'var_dump'
        105        SEND_VAR                                                 !1
        106        DO_ICALL                                                 
   35   107        INIT_FCALL                                               'var_dump'
        108        SEND_VAR                                                 !2
        109        DO_ICALL                                                 
        110      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.86 ms | 1408 KiB | 17 Q