3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = ';'; $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 += intval(substr($arrvalidrules[0], $intsignpos)); } else if (($intsignpos = strpos($arrvalidrules[0], '-')) !== false) { $intyearstart -= intval(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 = 68
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 67
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 = 66
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 65
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 49
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 64
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 64
Branch analysis from position: 65
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
Branch analysis from position: 67
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
filename:       /in/I7DYo
function name:  (null)
number of ops:  73
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, '%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, ->68
    9     9    >   ASSIGN                                                   !2, null
   11    10        FETCH_DIM_R                                      ~11     !1, 0
         11        IS_NOT_EQUAL                                             ~11, ''
         12      > JMPZ                                                     ~12, ->67
   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                                                      ->66
   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, ->65
   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, ->49
   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        CAST                                          4  ~29     $28
         47        ASSIGN_OP                                     1          !3, ~29
         48      > JMP                                                      ->64
   21    49    >   INIT_FCALL                                               'strpos'
         50        FETCH_DIM_R                                      ~31     !1, 0
         51        SEND_VAL                                                 ~31
         52        SEND_VAL                                                 '-'
         53        DO_ICALL                                         $32     
         54        ASSIGN                                           ~33     !4, $32
         55        TYPE_CHECK                                  1018          ~33
         56      > JMPZ                                                     ~34, ->64
   22    57    >   INIT_FCALL                                               'substr'
         58        FETCH_DIM_R                                      ~35     !1, 0
         59        SEND_VAL                                                 ~35
         60        SEND_VAR                                                 !4
         61        DO_ICALL                                         $36     
         62        CAST                                          4  ~37     $36
         63        ASSIGN_OP                                     2          !3, ~37
         64    > > JMP                                                      ->66
   26    65    >   ASSIGN                                                   !3, <false>
         66    > > JMP                                                      ->68
   30    67    >   ASSIGN                                                   !3, 0
   34    68    >   CONCAT                                           ~41     'Date+%3A+', !3
         69        CONCAT                                           ~42     ~41, '+-+'
         70        CONCAT                                           ~43     ~42, !2
         71        ECHO                                                     ~43
         72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.72 ms | 1392 KiB | 23 Q