3v4l.org

run code in 300+ PHP versions simultaneously
<?php $delivery = array( 'next' => 1, 'max' => 2, 'exclude' => array(6 => "Samstag", 7 => "Sonntag"), 'afterhour' => 14, 'message' => "Lieferung bis %tomorrow% (%tomorrow_date_full%) oder %dayaftertomorrow% (%dayaftertomorrow_date_full%)", 'translate' => array('tomorrow' => 'morgen', 'dayaftertomorrow' => 'übermorgen'), 'date' => date("d.m.Y")); function checkWeekend($delivery) { $wochentage = array( 1=>"Montag", 2=>"Dienstag", 3=>"Mittwoch", 4=>"Donnerstag", 5=>"Freitag", 6=>"Samstag", 7=>"Sonntag"); $currentDay = (int) date('N'); $found = []; while(count($found) < 2) { $currentDay = $currentDay + 1; if(isset($delivery['exclude'][$currentDay])) { $found[] = $wochentage[$currentDay]; } } var_dump($found); } checkWeekend($delivery); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cQmF4
function name:  (null)
number of ops:  15
compiled vars:  !0 = $delivery
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_ARRAY                                       ~1      1, 'next'
    4     1        ADD_ARRAY_ELEMENT                                ~1      2, 'max'
    3     2        ADD_ARRAY_ELEMENT                                ~1      <array>, 'exclude'
    6     3        ADD_ARRAY_ELEMENT                                ~1      14, 'afterhour'
    7     4        ADD_ARRAY_ELEMENT                                ~1      'Lieferung+bis+%25tomorrow%25+%28%25tomorrow_date_full%25%29+oder+%25dayaftertomorrow%25+%28%25dayaftertomorrow_date_full%25%29', 'message'
    3     5        ADD_ARRAY_ELEMENT                                ~1      <array>, 'translate'
    9     6        INIT_FCALL                                               'date'
          7        SEND_VAL                                                 'd.m.Y'
          8        DO_ICALL                                         $2      
          9        ADD_ARRAY_ELEMENT                                ~1      $2, 'date'
    2    10        ASSIGN                                                   !0, ~1
   36    11        INIT_FCALL                                               'checkweekend'
         12        SEND_VAR                                                 !0
         13        DO_FCALL                                      0          
   37    14      > RETURN                                                   1

Function checkweekend:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 9
Branch analysis from position: 20
Branch analysis from position: 9
Branch analysis from position: 17
filename:       /in/cQmF4
function name:  checkWeekend
number of ops:  24
compiled vars:  !0 = $delivery, !1 = $wochentage, !2 = $currentDay, !3 = $found
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ASSIGN                                                   !1, <array>
   22     2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'N'
          4        DO_ICALL                                         $5      
          5        CAST                                          4  ~6      $5
          6        ASSIGN                                                   !2, ~6
   24     7        ASSIGN                                                   !3, <array>
   25     8      > JMP                                                      ->17
   26     9    >   ADD                                              ~9      !2, 1
         10        ASSIGN                                                   !2, ~9
   27    11        FETCH_DIM_IS                                     ~11     !0, 'exclude'
         12        ISSET_ISEMPTY_DIM_OBJ                         0          ~11, !2
         13      > JMPZ                                                     ~12, ->17
   28    14    >   FETCH_DIM_R                                      ~14     !1, !2
         15        ASSIGN_DIM                                               !3
         16        OP_DATA                                                  ~14
   25    17    >   COUNT                                            ~15     !3
         18        IS_SMALLER                                               ~15, 2
         19      > JMPNZ                                                    ~16, ->9
   33    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                                 
   34    23      > RETURN                                                   null

End of function checkweekend

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.91 ms | 1403 KiB | 18 Q