3v4l.org

run code in 300+ PHP versions simultaneously
<?php $intj = 5; $arrformfields[$intj][3] = 'ok'; $arrformfields[$intj][18] = 'ok2'; ${$arrformfields[$intj][3]} = '1990'; ${$arrformfields[$intj][18]} = 4; $value = '1991;Y'; $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) // On va définir l'année de départ et de fin. { if ($arrvalidrules[$key]!='') // On a définit une valeur dans la règle. { if (is_numeric($arrvalidrules[$key])) // Valeur numérique fixe. { ${$label} = intval($arrvalidrules[$key]); } else if (strpos($arrvalidrules[$key], 'Y') === 0) // Valeur selon l'année actuelle. { ${$label} = date('Y'); if (($intsignpos = strpos($arrvalidrules[$key], '+')) !== false) // On vérifie si on souhaite faire une adition. { ${$label} += intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } else if (($intsignpos = strpos($arrvalidrules[$key], '-')) !== false) // On vérifie si on souhaite faire une soustraction. { ${$label} -= intval(trim(substr($arrvalidrules[$key], $intsignpos+1))); } } else // On a saisit une valeur erroné (du texte) on définit la valeur comme par défaut. { ${$label} = ($key == 0 ? str_pad(0, ${$arrformfields[$intj][18]}, '0') : null); } } else // Définition de la valeur par défaut (annéeDeb = 0, annéeFin = null). { ${$label} = ($key == 0 ? str_pad(0, ${$arrformfields[$intj][18]}, '0') : null); } } if ($intyearend !== null) { if ( (($intyearstart > $intyearend) && (${$arrformfields[$intj][3]} < $intyearend OR ${$arrformfields[$intj][3]} > $intyearstart)) OR ${$arrformfields[$intj][3]} < $intyearstart OR ${$arrformfields[$intj][3]} > $intyearend ) { if ($intyearstart > $intyearend) { // L'année de début > à la fin, on change les valeurs. $intswitch = $intyearstart; $intyearstart = $intyearend; $intyearend = $intswitch; } // "Le champ '".$arrformfields[$intj][1]."' est invalide, la valeur doit être comprise entre ".$intyearstart." et ".$intyearend." !<br />"; echo "Faux\n\n"; } else { echo ${$arrformfields[$intj][3]}; echo "Ok\n\n"; } } } echo 'Date : '.$intyearstart.' - '.$intyearend;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 168
Branch analysis from position: 24
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 127
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 127
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 111
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 41
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 126
Branch analysis from position: 126
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 95
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 74
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 94
Branch analysis from position: 94
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
Branch analysis from position: 74
2 jumps found. (Code = 43) Position 1 = 82, Position 2 = 94
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
Branch analysis from position: 94
Branch analysis from position: 95
2 jumps found. (Code = 43) Position 1 = 97, Position 2 = 107
Branch analysis from position: 97
1 jumps found. (Code = 42) Position 1 = 108
Branch analysis from position: 108
1 jumps found. (Code = 42) Position 1 = 126
Branch analysis from position: 126
Branch analysis from position: 107
1 jumps found. (Code = 42) Position 1 = 126
Branch analysis from position: 126
Branch analysis from position: 111
2 jumps found. (Code = 43) Position 1 = 113, Position 2 = 123
Branch analysis from position: 113
1 jumps found. (Code = 42) Position 1 = 124
Branch analysis from position: 124
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 123
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 127
2 jumps found. (Code = 43) Position 1 = 130, Position 2 = 168
Branch analysis from position: 130
2 jumps found. (Code = 46) Position 1 = 132, Position 2 = 143
Branch analysis from position: 132
2 jumps found. (Code = 47) Position 1 = 137, Position 2 = 142
Branch analysis from position: 137
2 jumps found. (Code = 47) Position 1 = 144, Position 2 = 149
Branch analysis from position: 144
2 jumps found. (Code = 47) Position 1 = 150, Position 2 = 155
Branch analysis from position: 150
2 jumps found. (Code = 43) Position 1 = 156, Position 2 = 163
Branch analysis from position: 156
2 jumps found. (Code = 43) Position 1 = 158, Position 2 = 161
Branch analysis from position: 158
1 jumps found. (Code = 42) Position 1 = 168
Branch analysis from position: 168
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 161
Branch analysis from position: 163
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 155
Branch analysis from position: 149
Branch analysis from position: 142
Branch analysis from position: 143
Branch analysis from position: 168
Branch analysis from position: 127
Branch analysis from position: 168
filename:       /in/YkC8F
function name:  (null)
number of ops:  173
compiled vars:  !0 = $intj, !1 = $arrformfields, !2 = $value, !3 = $arrvalidrules, !4 = $arrvarlabels, !5 = $label, !6 = $key, !7 = $intsignpos, !8 = $intyearend, !9 = $intyearstart, !10 = $intswitch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        FETCH_DIM_W                                      $12     !1, !0
          2        ASSIGN_DIM                                               $12, 3
          3        OP_DATA                                                  'ok'
    5     4        FETCH_DIM_W                                      $14     !1, !0
          5        ASSIGN_DIM                                               $14, 18
          6        OP_DATA                                                  'ok2'
    6     7        FETCH_DIM_R                                      ~16     !1, !0
          8        FETCH_DIM_R                                      ~17     ~16, 3
          9        FETCH_W                      local               $18     ~17
         10        ASSIGN                                                   $18, '1990'
    7    11        FETCH_DIM_R                                      ~20     !1, !0
         12        FETCH_DIM_R                                      ~21     ~20, 18
         13        FETCH_W                      local               $22     ~21
         14        ASSIGN                                                   $22, 4
    9    15        ASSIGN                                                   !2, '1991%3BY'
   11    16        INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '%3B'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $25     
         20        ASSIGN                                                   !3, $25
   14    21        COUNT                                            ~27     !3
         22        IS_EQUAL                                                 ~27, 2
         23      > JMPZ                                                     ~28, ->168
   15    24    >   ASSIGN                                                   !4, <array>
   17    25      > FE_RESET_R                                       $30     !4, ->127
         26    > > FE_FETCH_R                                       ~31     $30, !5, ->127
         27    >   ASSIGN                                                   !6, ~31
   19    28        FETCH_DIM_R                                      ~33     !3, !6
         29        IS_NOT_EQUAL                                             ~33, ''
         30      > JMPZ                                                     ~34, ->111
   21    31    >   INIT_FCALL                                               'is_numeric'
         32        FETCH_DIM_R                                      ~35     !3, !6
         33        SEND_VAL                                                 ~35
         34        DO_ICALL                                         $36     
         35      > JMPZ                                                     $36, ->41
   23    36    >   FETCH_DIM_R                                      ~38     !3, !6
         37        CAST                                          4  ~39     ~38
         38        FETCH_W                      local               $37     !5
         39        ASSIGN                                                   $37, ~39
         40      > JMP                                                      ->110
   25    41    >   INIT_FCALL                                               'strpos'
         42        FETCH_DIM_R                                      ~41     !3, !6
         43        SEND_VAL                                                 ~41
         44        SEND_VAL                                                 'Y'
         45        DO_ICALL                                         $42     
         46        IS_IDENTICAL                                             $42, 0
         47      > JMPZ                                                     ~43, ->95
   27    48    >   INIT_FCALL                                               'date'
         49        SEND_VAL                                                 'Y'
         50        DO_ICALL                                         $45     
         51        FETCH_W                      local               $44     !5
         52        ASSIGN                                                   $44, $45
   29    53        INIT_FCALL                                               'strpos'
         54        FETCH_DIM_R                                      ~47     !3, !6
         55        SEND_VAL                                                 ~47
         56        SEND_VAL                                                 '%2B'
         57        DO_ICALL                                         $48     
         58        ASSIGN                                           ~49     !7, $48
         59        TYPE_CHECK                                  1018          ~49
         60      > JMPZ                                                     ~50, ->74
   31    61    >   INIT_FCALL                                               'trim'
         62        INIT_FCALL                                               'substr'
         63        FETCH_DIM_R                                      ~52     !3, !6
         64        SEND_VAL                                                 ~52
         65        ADD                                              ~53     !7, 1
         66        SEND_VAL                                                 ~53
         67        DO_ICALL                                         $54     
         68        SEND_VAR                                                 $54
         69        DO_ICALL                                         $55     
         70        CAST                                          4  ~56     $55
         71        FETCH_RW                     local               $51     !5
         72        ASSIGN_OP                                     1          $51, ~56
         73      > JMP                                                      ->94
   33    74    >   INIT_FCALL                                               'strpos'
         75        FETCH_DIM_R                                      ~58     !3, !6
         76        SEND_VAL                                                 ~58
         77        SEND_VAL                                                 '-'
         78        DO_ICALL                                         $59     
         79        ASSIGN                                           ~60     !7, $59
         80        TYPE_CHECK                                  1018          ~60
         81      > JMPZ                                                     ~61, ->94
   35    82    >   INIT_FCALL                                               'trim'
         83        INIT_FCALL                                               'substr'
         84        FETCH_DIM_R                                      ~63     !3, !6
         85        SEND_VAL                                                 ~63
         86        ADD                                              ~64     !7, 1
         87        SEND_VAL                                                 ~64
         88        DO_ICALL                                         $65     
         89        SEND_VAR                                                 $65
         90        DO_ICALL                                         $66     
         91        CAST                                          4  ~67     $66
         92        FETCH_RW                     local               $62     !5
         93        ASSIGN_OP                                     2          $62, ~67
         94    > > JMP                                                      ->110
   40    95    >   IS_EQUAL                                                 !6, 0
         96      > JMPZ                                                     ~70, ->107
         97    >   INIT_FCALL                                               'str_pad'
         98        SEND_VAL                                                 0
         99        FETCH_DIM_R                                      ~71     !1, !0
        100        FETCH_DIM_R                                      ~72     ~71, 18
        101        FETCH_R                      local               ~73     ~72
        102        SEND_VAL                                                 ~73
        103        SEND_VAL                                                 '0'
        104        DO_ICALL                                         $74     
        105        QM_ASSIGN                                        ~75     $74
        106      > JMP                                                      ->108
        107    >   QM_ASSIGN                                        ~75     null
        108    >   FETCH_W                      local               $69     !5
        109        ASSIGN                                                   $69, ~75
        110    > > JMP                                                      ->126
   45   111    >   IS_EQUAL                                                 !6, 0
        112      > JMPZ                                                     ~78, ->123
        113    >   INIT_FCALL                                               'str_pad'
        114        SEND_VAL                                                 0
        115        FETCH_DIM_R                                      ~79     !1, !0
        116        FETCH_DIM_R                                      ~80     ~79, 18
        117        FETCH_R                      local               ~81     ~80
        118        SEND_VAL                                                 ~81
        119        SEND_VAL                                                 '0'
        120        DO_ICALL                                         $82     
        121        QM_ASSIGN                                        ~83     $82
        122      > JMP                                                      ->124
        123    >   QM_ASSIGN                                        ~83     null
        124    >   FETCH_W                      local               $77     !5
        125        ASSIGN                                                   $77, ~83
   17   126    > > JMP                                                      ->26
        127    >   FE_FREE                                                  $30
   49   128        TYPE_CHECK                                  1020          !8
        129      > JMPZ                                                     ~85, ->168
   51   130    >   IS_SMALLER                                       ~86     !8, !9
        131      > JMPZ_EX                                          ~86     ~86, ->143
        132    >   FETCH_DIM_R                                      ~87     !1, !0
        133        FETCH_DIM_R                                      ~88     ~87, 3
        134        FETCH_R                      local               ~89     ~88
        135        IS_SMALLER                                       ~90     ~89, !8
        136      > JMPNZ_EX                                         ~90     ~90, ->142
        137    >   FETCH_DIM_R                                      ~91     !1, !0
        138        FETCH_DIM_R                                      ~92     ~91, 3
        139        FETCH_R                      local               ~93     ~92
        140        IS_SMALLER                                       ~94     !9, ~93
        141        BOOL                                             ~90     ~94
        142    >   BOOL                                             ~86     ~90
        143    > > JMPNZ_EX                                         ~86     ~86, ->149
   53   144    >   FETCH_DIM_R                                      ~95     !1, !0
        145        FETCH_DIM_R                                      ~96     ~95, 3
        146        FETCH_R                      local               ~97     ~96
        147        IS_SMALLER                                       ~98     ~97, !9
        148        BOOL                                             ~86     ~98
        149    > > JMPNZ_EX                                         ~86     ~86, ->155
        150    >   FETCH_DIM_R                                      ~99     !1, !0
        151        FETCH_DIM_R                                      ~100    ~99, 3
        152        FETCH_R                      local               ~101    ~100
        153        IS_SMALLER                                       ~102    !8, ~101
        154        BOOL                                             ~86     ~102
        155    > > JMPZ                                                     ~86, ->163
   56   156    >   IS_SMALLER                                               !8, !9
        157      > JMPZ                                                     ~103, ->161
   57   158    >   ASSIGN                                                   !10, !9
   58   159        ASSIGN                                                   !9, !8
   59   160        ASSIGN                                                   !8, !10
   63   161    >   ECHO                                                     'Faux%0A%0A'
        162      > JMP                                                      ->168
   66   163    >   FETCH_DIM_R                                      ~107    !1, !0
        164        FETCH_DIM_R                                      ~108    ~107, 3
        165        FETCH_R                      local               ~109    ~108
        166        ECHO                                                     ~109
   67   167        ECHO                                                     'Ok%0A%0A'
   72   168    >   CONCAT                                           ~110    'Date+%3A+', !9
        169        CONCAT                                           ~111    ~110, '+-+'
        170        CONCAT                                           ~112    ~111, !8
        171        ECHO                                                     ~112
        172      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.24 ms | 1404 KiB | 27 Q