3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 'Y+10;'; $arrvalidrules = explode(';', $value); // On vérifie qu'il n'y bien que deux valeurs. if (count($arrvalidrules) == 2) { $intyearend = null; if ($arrvalidrules[0]!='') { if (is_numeric($arrvalidrules[0])) { $intyearstart=intval($arrvalidrules[0]); } else if (strpos($arrvalidrules[0], 'Y') === 0) { $intyearstart = date('Y'); if (($intsignpos = strpos($arrvalidrules[0], '+')) !== false) { $intyearstart += (int) (trim(substr($arrvalidrules[0], $intsignpos))); } else if (($intsignpos = strpos($arrvalidrules[0], '-')) !== false) { $intyearstart -= (int) (trim(substr($arrvalidrules[0], $intsignpos))); } } else { $intyearstart = false; } } else { $intyearstart = 0; } } echo 'Date : '.$intyearstart.' - '.$intyearend;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 74
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 73
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 71
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 52
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 70
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 70
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
Branch analysis from position: 70
Branch analysis from position: 71
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
filename:       /in/6tOJB
function name:  (null)
number of ops:  79
compiled vars:  !0 = $value, !1 = $arrvalidrules, !2 = $intyearend, !3 = $intyearstart, !4 = $intsignpos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Y%2B10%3B'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3B'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    8     6        COUNT                                            ~8      !1
          7        IS_EQUAL                                                 ~8, 2
          8      > JMPZ                                                     ~9, ->74
    9     9    >   ASSIGN                                                   !2, null
   11    10        FETCH_DIM_R                                      ~11     !1, 0
         11        IS_NOT_EQUAL                                             ~11, ''
         12      > JMPZ                                                     ~12, ->73
   12    13    >   INIT_FCALL                                               'is_numeric'
         14        FETCH_DIM_R                                      ~13     !1, 0
         15        SEND_VAL                                                 ~13
         16        DO_ICALL                                         $14     
         17      > JMPZ                                                     $14, ->22
   13    18    >   FETCH_DIM_R                                      ~15     !1, 0
         19        CAST                                          4  ~16     ~15
         20        ASSIGN                                                   !3, ~16
         21      > JMP                                                      ->72
   15    22    >   INIT_FCALL                                               'strpos'
         23        FETCH_DIM_R                                      ~18     !1, 0
         24        SEND_VAL                                                 ~18
         25        SEND_VAL                                                 'Y'
         26        DO_ICALL                                         $19     
         27        IS_IDENTICAL                                             $19, 0
         28      > JMPZ                                                     ~20, ->71
   16    29    >   INIT_FCALL                                               'date'
         30        SEND_VAL                                                 'Y'
         31        DO_ICALL                                         $21     
         32        ASSIGN                                                   !3, $21
   18    33        INIT_FCALL                                               'strpos'
         34        FETCH_DIM_R                                      ~23     !1, 0
         35        SEND_VAL                                                 ~23
         36        SEND_VAL                                                 '%2B'
         37        DO_ICALL                                         $24     
         38        ASSIGN                                           ~25     !4, $24
         39        TYPE_CHECK                                  1018          ~25
         40      > JMPZ                                                     ~26, ->52
   19    41    >   INIT_FCALL                                               'trim'
         42        INIT_FCALL                                               'substr'
         43        FETCH_DIM_R                                      ~27     !1, 0
         44        SEND_VAL                                                 ~27
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                         $28     
         47        SEND_VAR                                                 $28
         48        DO_ICALL                                         $29     
         49        CAST                                          4  ~30     $29
         50        ASSIGN_OP                                     1          !3, ~30
         51      > JMP                                                      ->70
   21    52    >   INIT_FCALL                                               'strpos'
         53        FETCH_DIM_R                                      ~32     !1, 0
         54        SEND_VAL                                                 ~32
         55        SEND_VAL                                                 '-'
         56        DO_ICALL                                         $33     
         57        ASSIGN                                           ~34     !4, $33
         58        TYPE_CHECK                                  1018          ~34
         59      > JMPZ                                                     ~35, ->70
   22    60    >   INIT_FCALL                                               'trim'
         61        INIT_FCALL                                               'substr'
         62        FETCH_DIM_R                                      ~36     !1, 0
         63        SEND_VAL                                                 ~36
         64        SEND_VAR                                                 !4
         65        DO_ICALL                                         $37     
         66        SEND_VAR                                                 $37
         67        DO_ICALL                                         $38     
         68        CAST                                          4  ~39     $38
         69        ASSIGN_OP                                     2          !3, ~39
         70    > > JMP                                                      ->72
   26    71    >   ASSIGN                                                   !3, <false>
         72    > > JMP                                                      ->74
   30    73    >   ASSIGN                                                   !3, 0
   34    74    >   CONCAT                                           ~43     'Date+%3A+', !3
         75        CONCAT                                           ~44     ~43, '+-+'
         76        CONCAT                                           ~45     ~44, !2
         77        ECHO                                                     ~45
         78      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.49 ms | 1396 KiB | 25 Q