3v4l.org

run code in 300+ PHP versions simultaneously
<?php $days = []; $searchData = ['dat' => '2015-11-15']; $offset = 3; $now = date_create(); if (date_create($searchData['dat'])->modify('- '. $offset .' days') < $now) { $offsetStart = date_create($searchData['dat'])->diff($now)->format('%a'); } else { $offsetStart = -1 * $offset; } $offsetEnd = 2 * $offset + $offsetStart; for ($i = $offsetStart; $i <= $offsetEnd; $i++) { $days[] = $i; } print_r($days);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 29
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 36
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 36
Branch analysis from position: 41
Branch analysis from position: 36
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
filename:       /in/mJMZJ
function name:  (null)
number of ops:  45
compiled vars:  !0 = $days, !1 = $searchData, !2 = $offset, !3 = $now, !4 = $offsetStart, !5 = $offsetEnd, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 3
    6     3        INIT_FCALL                                               'date_create'
          4        DO_ICALL                                         $10     
          5        ASSIGN                                                   !3, $10
    7     6        INIT_FCALL                                               'date_create'
          7        FETCH_DIM_R                                      ~12     !1, 'dat'
          8        SEND_VAL                                                 ~12
          9        DO_ICALL                                         $13     
         10        INIT_METHOD_CALL                                         $13, 'modify'
         11        CONCAT                                           ~14     '-+', !2
         12        CONCAT                                           ~15     ~14, '+days'
         13        SEND_VAL_EX                                              ~15
         14        DO_FCALL                                      0  $16     
         15        IS_SMALLER                                               $16, !3
         16      > JMPZ                                                     ~17, ->29
    8    17    >   INIT_FCALL                                               'date_create'
         18        FETCH_DIM_R                                      ~18     !1, 'dat'
         19        SEND_VAL                                                 ~18
         20        DO_ICALL                                         $19     
         21        INIT_METHOD_CALL                                         $19, 'diff'
         22        SEND_VAR_EX                                              !3
         23        DO_FCALL                                      0  $20     
         24        INIT_METHOD_CALL                                         $20, 'format'
         25        SEND_VAL_EX                                              '%25a'
         26        DO_FCALL                                      0  $21     
         27        ASSIGN                                                   !4, $21
         28      > JMP                                                      ->31
   10    29    >   MUL                                              ~23     !2, -1
         30        ASSIGN                                                   !4, ~23
   12    31    >   MUL                                              ~25     !2, 2
         32        ADD                                              ~26     ~25, !4
         33        ASSIGN                                                   !5, ~26
   14    34        ASSIGN                                                   !6, !4
         35      > JMP                                                      ->39
   15    36    >   ASSIGN_DIM                                               !0
         37        OP_DATA                                                  !6
   14    38        PRE_INC                                                  !6
         39    >   IS_SMALLER_OR_EQUAL                                      !6, !5
         40      > JMPNZ                                                    ~31, ->36
   18    41    >   INIT_FCALL                                               'print_r'
         42        SEND_VAR                                                 !0
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.85 ms | 1400 KiB | 17 Q