3v4l.org

run code in 300+ PHP versions simultaneously
<?php $days = []; $searchData = ['dat' => '2015-11-13']; $offset = 3; $now = date_create(); if (date_create($searchData['dat'])->modify('- '. $offset .' days') < $now) { $offsetStart = -1 * 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 = 30
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 37
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 42, Position 2 = 37
Branch analysis from position: 42
Branch analysis from position: 37
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
filename:       /in/e0voh
function name:  (null)
number of ops:  46
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, ->30
    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        MUL                                              ~22     $21, -1
         28        ASSIGN                                                   !4, ~22
         29      > JMP                                                      ->32
   10    30    >   MUL                                              ~24     !2, -1
         31        ASSIGN                                                   !4, ~24
   12    32    >   MUL                                              ~26     !2, 2
         33        ADD                                              ~27     ~26, !4
         34        ASSIGN                                                   !5, ~27
   14    35        ASSIGN                                                   !6, !4
         36      > JMP                                                      ->40
   15    37    >   ASSIGN_DIM                                               !0
         38        OP_DATA                                                  !6
   14    39        PRE_INC                                                  !6
         40    >   IS_SMALLER_OR_EQUAL                                      !6, !5
         41      > JMPNZ                                                    ~32, ->37
   18    42    >   INIT_FCALL                                               'print_r'
         43        SEND_VAR                                                 !0
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.24 ms | 1400 KiB | 17 Q