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) { echo 'Test:'.substr($arrvalidrules[0], $intsignpos); $intyearstart += (int) (trim(substr($arrvalidrules[0], $intsignpos+1))); } else if (($intsignpos = strpos($arrvalidrules[0], '-')) !== false) { $intyearstart -= (int) (trim(substr($arrvalidrules[0], $intsignpos+1))); } } 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 = 83
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 82
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 = 81
Branch analysis from position: 81
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 80
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 60
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 79
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 68, Position 2 = 79
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 81
Branch analysis from position: 81
Branch analysis from position: 79
Branch analysis from position: 80
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
Branch analysis from position: 82
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 83
filename:       /in/cMjZM
function name:  (null)
number of ops:  88
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+%2B+10%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, ->83
    9     9    >   ASSIGN                                                   !2, null
   11    10        FETCH_DIM_R                                      ~11     !1, 0
         11        IS_NOT_EQUAL                                             ~11, ''
         12      > JMPZ                                                     ~12, ->82
   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                                                      ->81
   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, ->80
   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, ->60
   19    41    >   INIT_FCALL                                               'substr'
         42        FETCH_DIM_R                                      ~27     !1, 0
         43        SEND_VAL                                                 ~27
         44        SEND_VAR                                                 !4
         45        DO_ICALL                                         $28     
         46        CONCAT                                           ~29     'Test%3A', $28
         47        ECHO                                                     ~29
   20    48        INIT_FCALL                                               'trim'
         49        INIT_FCALL                                               'substr'
         50        FETCH_DIM_R                                      ~30     !1, 0
         51        SEND_VAL                                                 ~30
         52        ADD                                              ~31     !4, 1
         53        SEND_VAL                                                 ~31
         54        DO_ICALL                                         $32     
         55        SEND_VAR                                                 $32
         56        DO_ICALL                                         $33     
         57        CAST                                          4  ~34     $33
         58        ASSIGN_OP                                     1          !3, ~34
         59      > JMP                                                      ->79
   22    60    >   INIT_FCALL                                               'strpos'
         61        FETCH_DIM_R                                      ~36     !1, 0
         62        SEND_VAL                                                 ~36
         63        SEND_VAL                                                 '-'
         64        DO_ICALL                                         $37     
         65        ASSIGN                                           ~38     !4, $37
         66        TYPE_CHECK                                  1018          ~38
         67      > JMPZ                                                     ~39, ->79
   23    68    >   INIT_FCALL                                               'trim'
         69        INIT_FCALL                                               'substr'
         70        FETCH_DIM_R                                      ~40     !1, 0
         71        SEND_VAL                                                 ~40
         72        ADD                                              ~41     !4, 1
         73        SEND_VAL                                                 ~41
         74        DO_ICALL                                         $42     
         75        SEND_VAR                                                 $42
         76        DO_ICALL                                         $43     
         77        CAST                                          4  ~44     $43
         78        ASSIGN_OP                                     2          !3, ~44
         79    > > JMP                                                      ->81
   27    80    >   ASSIGN                                                   !3, <false>
         81    > > JMP                                                      ->83
   31    82    >   ASSIGN                                                   !3, 0
   35    83    >   CONCAT                                           ~48     'Date+%3A+', !3
         84        CONCAT                                           ~49     ~48, '+-+'
         85        CONCAT                                           ~50     ~49, !2
         86        ECHO                                                     ~50
         87      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.15 ms | 1404 KiB | 25 Q