3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 'qsd;qsd'; $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 => $label) { if ($arrvalidrules[$key]!='') { if (is_numeric($arrvalidrules[$key])) { ${$label} = intval($arrvalidrules[$key]); } else if (strpos($arrvalidrules[$key], 'Y') === 0) { ${$label} = date('Y'); if (($intsignpos = strpos($arrvalidrules[$key], '+')) !== false) { ${$label} += intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } else if (($intsignpos = strpos($arrvalidrules[$key], '-')) !== false) { ${$label} -= intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } } else { ${$label} = ($key == 0 ? 0 : null); } } else { ${$label} = ($key == 0 ? 0 : null); } } } echo 'Date : '.$intyearstart.' - '.$intyearend;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 97
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 96
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 96
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 88
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 = 87
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
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 = 87
Branch analysis from position: 87
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 = 87
Branch analysis from position: 87
Branch analysis from position: 79
Branch analysis from position: 80
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 84
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 = 95
Branch analysis from position: 95
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 92
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 93
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 96
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 96
Branch analysis from position: 97
filename:       /in/7kgT8
function name:  (null)
number of ops:  102
compiled vars:  !0 = $value, !1 = $arrvalidrules, !2 = $arrvarlabels, !3 = $label, !4 = $key, !5 = $intsignpos, !6 = $intyearstart, !7 = $intyearend
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'qsd%3Bqsd'
    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, ->97
    9     9    >   ASSIGN                                                   !2, <array>
   11    10      > FE_RESET_R                                       $14     !2, ->96
         11    > > FE_FETCH_R                                       ~15     $14, !3, ->96
         12    >   ASSIGN                                                   !4, ~15
   13    13        FETCH_DIM_R                                      ~17     !1, !4
         14        IS_NOT_EQUAL                                             ~17, ''
         15      > JMPZ                                                     ~18, ->88
   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     !3
         24        ASSIGN                                                   $21, ~23
         25      > JMP                                                      ->87
   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     !3
         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     !3
         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     !3
         78        ASSIGN_OP                                     2          $46, ~51
         79    > > JMP                                                      ->87
   34    80    >   IS_EQUAL                                                 !4, 0
         81      > JMPZ                                                     ~54, ->84
         82    >   QM_ASSIGN                                        ~55     0
         83      > JMP                                                      ->85
         84    >   QM_ASSIGN                                        ~55     null
         85    >   FETCH_W                      local               $53     !3
         86        ASSIGN                                                   $53, ~55
         87    > > JMP                                                      ->95
   39    88    >   IS_EQUAL                                                 !4, 0
         89      > JMPZ                                                     ~58, ->92
         90    >   QM_ASSIGN                                        ~59     0
         91      > JMP                                                      ->93
         92    >   QM_ASSIGN                                        ~59     null
         93    >   FETCH_W                      local               $57     !3
         94        ASSIGN                                                   $57, ~59
   11    95    > > JMP                                                      ->11
         96    >   FE_FREE                                                  $14
   44    97    >   CONCAT                                           ~61     'Date+%3A+', !6
         98        CONCAT                                           ~62     ~61, '+-+'
         99        CONCAT                                           ~63     ~62, !7
        100        ECHO                                                     ~63
        101      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.2 ms | 1404 KiB | 25 Q