3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_GET['modeldate'] = '2016012200z'; // I chose key 8 $dates = array ( 0 => '2016012400z', 1 => '2016012318z', 2 => '2016012312z', 3 => '2016012306z', 4 => '2016012300z', 5 => '2016012218z', 6 => '2016012212z', 7 => '2016012206z', 8 => '2016012200z', 9 => '2016012118z', 10 => '2016012112z', 11 => '2016012106z', 12 => '2016012100z', 13 => '2016012018z', 14 => '2016012012z', 15 => '2016012006z', 16 => '2016012000z', 17 => '2016011918z', 18 => '2016011912z', 19 => '2016011906z', 20 => '2016011900z', 21 => '2016011818z', 22 => '2016011812z', 23 => '2016011806z', 24 => '2016011800z', 25 => '2016011718z', 26 => '2016011712z', 27 => '2016011706z', 28 => '2016011700z', 29 => '2016011618z', 30 => '2016011612z', 31 => '2016011606z', 32 => '2016011600z', 33 => '2016011518z', 34 => '2016011512z', 35 => '2016011506z', 36 => '2016011500z', 37 => '2016011418z', 38 => '2016011412z', 39 => '2016011406z', 40 => '2016011400z', 41 => '2016011318z', 42 => '2016011312z', 43 => '2016011306z', 44 => '2016011300z', 45 => '2016011218z', 46 => '2016011212z', 47 => '2016011206z', 48 => '2016011200z', 49 => '2016011118z', 50 => '2016011112z', 51 => '2016011106z', 52 => '2016011100z', 53 => '2016011018z', 54 => '2016011012z', 55 => '2016011006z', ); $prevdate = $nextdate = $currentdate = $dates[0]; $modeldate = false; if (!empty($_GET['modeldate'])) { $modeldate=$_GET['modeldate']; } if ($modeldate) { foreach($dates as $k => $date) { $nextdate = $currentdate; if ($modeldate === $date) { $currentdate = $date; $prevdate = $dates[$k+1]; break; } } } var_dump(($nextdate === $dates[7])??$nextdate, $currentdate === $dates[8], $prevdate === $dates[9]);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 30
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 29
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 29
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 28
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 29
Branch analysis from position: 29
Branch analysis from position: 30
Branch analysis from position: 16
filename:       /in/jmqHH
function name:  (null)
number of ops:  44
compiled vars:  !0 = $dates, !1 = $prevdate, !2 = $nextdate, !3 = $currentdate, !4 = $modeldate, !5 = $date, !6 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_W                      global              $7      '_GET'
          1        ASSIGN_DIM                                               $7, 'modeldate'
          2        OP_DATA                                                  '2016012200z'
    3     3        ASSIGN                                                   !0, <array>
   61     4        FETCH_DIM_R                                      ~10     !0, 0
          5        ASSIGN                                           ~11     !3, ~10
          6        ASSIGN                                           ~12     !2, ~11
          7        ASSIGN                                                   !1, ~12
   62     8        ASSIGN                                                   !4, <false>
   63     9        FETCH_IS                                         ~15     '_GET'
         10        ISSET_ISEMPTY_DIM_OBJ                         1  ~16     ~15, 'modeldate'
         11        BOOL_NOT                                         ~17     ~16
         12      > JMPZ                                                     ~17, ->16
   64    13    >   FETCH_R                      global              ~18     '_GET'
         14        FETCH_DIM_R                                      ~19     ~18, 'modeldate'
         15        ASSIGN                                                   !4, ~19
   67    16    > > JMPZ                                                     !4, ->30
   68    17    > > FE_RESET_R                                       $21     !0, ->29
         18    > > FE_FETCH_R                                       ~22     $21, !5, ->29
         19    >   ASSIGN                                                   !6, ~22
   69    20        ASSIGN                                                   !2, !3
   70    21        IS_IDENTICAL                                             !4, !5
         22      > JMPZ                                                     ~25, ->28
   71    23    >   ASSIGN                                                   !3, !5
   72    24        ADD                                              ~27     !6, 1
         25        FETCH_DIM_R                                      ~28     !0, ~27
         26        ASSIGN                                                   !1, ~28
   73    27      > JMP                                                      ->29
   68    28    > > JMP                                                      ->18
         29    >   FE_FREE                                                  $21
   78    30    >   INIT_FCALL                                               'var_dump'
         31        FETCH_DIM_R                                      ~30     !0, 7
         32        IS_IDENTICAL                                     ~31     !2, ~30
         33        COALESCE                                         ~32     ~31
         34        QM_ASSIGN                                        ~32     !2
         35        SEND_VAL                                                 ~32
         36        FETCH_DIM_R                                      ~33     !0, 8
         37        IS_IDENTICAL                                     ~34     !3, ~33
         38        SEND_VAL                                                 ~34
         39        FETCH_DIM_R                                      ~35     !0, 9
         40        IS_IDENTICAL                                     ~36     !1, ~35
         41        SEND_VAL                                                 ~36
         42        DO_ICALL                                                 
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.94 ms | 1400 KiB | 15 Q