3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.23 ms | 1404 KiB | 25 Q