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 = '1989;1950'; $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; } $strerrormessage.="Le champ '".$arrformfields[$intj][1]."' est invalide, la valeur doit être comprise entre ".$intyearstart." et ".$intyearend." !<br />"; } } else if (${$arrformfields[$intj][3]} < $intyearstart) { $strerrormessage.="Le champ '".$arrformfields[$intj][1]."' est invalide, la valeur doit être comprise entre ".$intyearstart." et ".$intyearend." !<br />"; } } echo 'Date : '.$intyearstart.' - '.$intyearend;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 185
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 = 171
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 = 170
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 = 185
Branch analysis from position: 185
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 161
Branch analysis from position: 170
Branch analysis from position: 155
Branch analysis from position: 149
Branch analysis from position: 142
Branch analysis from position: 143
Branch analysis from position: 171
2 jumps found. (Code = 43) Position 1 = 176, Position 2 = 185
Branch analysis from position: 176
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 185
Branch analysis from position: 127
Branch analysis from position: 185
filename:       /in/lGPNm
function name:  (null)
number of ops:  190
compiled vars:  !0 = $intj, !1 = $arrformfields, !2 = $value, !3 = $arrvalidrules, !4 = $arrvarlabels, !5 = $label, !6 = $key, !7 = $intsignpos, !8 = $intyearend, !9 = $intyearstart, !10 = $intswitch, !11 = $strerrormessage
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        FETCH_DIM_W                                      $13     !1, !0
          2        ASSIGN_DIM                                               $13, 3
          3        OP_DATA                                                  'ok'
    5     4        FETCH_DIM_W                                      $15     !1, !0
          5        ASSIGN_DIM                                               $15, 18
          6        OP_DATA                                                  'ok2'
    6     7        FETCH_DIM_R                                      ~17     !1, !0
          8        FETCH_DIM_R                                      ~18     ~17, 3
          9        FETCH_W                      local               $19     ~18
         10        ASSIGN                                                   $19, '1990'
    7    11        FETCH_DIM_R                                      ~21     !1, !0
         12        FETCH_DIM_R                                      ~22     ~21, 18
         13        FETCH_W                      local               $23     ~22
         14        ASSIGN                                                   $23, 4
    9    15        ASSIGN                                                   !2, '1989%3B1950'
   11    16        INIT_FCALL                                               'explode'
         17        SEND_VAL                                                 '%3B'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $26     
         20        ASSIGN                                                   !3, $26
   14    21        COUNT                                            ~28     !3
         22        IS_EQUAL                                                 ~28, 2
         23      > JMPZ                                                     ~29, ->185
   15    24    >   ASSIGN                                                   !4, <array>
   17    25      > FE_RESET_R                                       $31     !4, ->127
         26    > > FE_FETCH_R                                       ~32     $31, !5, ->127
         27    >   ASSIGN                                                   !6, ~32
   19    28        FETCH_DIM_R                                      ~34     !3, !6
         29        IS_NOT_EQUAL                                             ~34, ''
         30      > JMPZ                                                     ~35, ->111
   21    31    >   INIT_FCALL                                               'is_numeric'
         32        FETCH_DIM_R                                      ~36     !3, !6
         33        SEND_VAL                                                 ~36
         34        DO_ICALL                                         $37     
         35      > JMPZ                                                     $37, ->41
   23    36    >   FETCH_DIM_R                                      ~39     !3, !6
         37        CAST                                          4  ~40     ~39
         38        FETCH_W                      local               $38     !5
         39        ASSIGN                                                   $38, ~40
         40      > JMP                                                      ->110
   25    41    >   INIT_FCALL                                               'strpos'
         42        FETCH_DIM_R                                      ~42     !3, !6
         43        SEND_VAL                                                 ~42
         44        SEND_VAL                                                 'Y'
         45        DO_ICALL                                         $43     
         46        IS_IDENTICAL                                             $43, 0
         47      > JMPZ                                                     ~44, ->95
   27    48    >   INIT_FCALL                                               'date'
         49        SEND_VAL                                                 'Y'
         50        DO_ICALL                                         $46     
         51        FETCH_W                      local               $45     !5
         52        ASSIGN                                                   $45, $46
   29    53        INIT_FCALL                                               'strpos'
         54        FETCH_DIM_R                                      ~48     !3, !6
         55        SEND_VAL                                                 ~48
         56        SEND_VAL                                                 '%2B'
         57        DO_ICALL                                         $49     
         58        ASSIGN                                           ~50     !7, $49
         59        TYPE_CHECK                                  1018          ~50
         60      > JMPZ                                                     ~51, ->74
   31    61    >   INIT_FCALL                                               'trim'
         62        INIT_FCALL                                               'substr'
         63        FETCH_DIM_R                                      ~53     !3, !6
         64        SEND_VAL                                                 ~53
         65        ADD                                              ~54     !7, 1
         66        SEND_VAL                                                 ~54
         67        DO_ICALL                                         $55     
         68        SEND_VAR                                                 $55
         69        DO_ICALL                                         $56     
         70        CAST                                          4  ~57     $56
         71        FETCH_RW                     local               $52     !5
         72        ASSIGN_OP                                     1          $52, ~57
         73      > JMP                                                      ->94
   33    74    >   INIT_FCALL                                               'strpos'
         75        FETCH_DIM_R                                      ~59     !3, !6
         76        SEND_VAL                                                 ~59
         77        SEND_VAL                                                 '-'
         78        DO_ICALL                                         $60     
         79        ASSIGN                                           ~61     !7, $60
         80        TYPE_CHECK                                  1018          ~61
         81      > JMPZ                                                     ~62, ->94
   35    82    >   INIT_FCALL                                               'trim'
         83        INIT_FCALL                                               'substr'
         84        FETCH_DIM_R                                      ~64     !3, !6
         85        SEND_VAL                                                 ~64
         86        ADD                                              ~65     !7, 1
         87        SEND_VAL                                                 ~65
         88        DO_ICALL                                         $66     
         89        SEND_VAR                                                 $66
         90        DO_ICALL                                         $67     
         91        CAST                                          4  ~68     $67
         92        FETCH_RW                     local               $63     !5
         93        ASSIGN_OP                                     2          $63, ~68
         94    > > JMP                                                      ->110
   40    95    >   IS_EQUAL                                                 !6, 0
         96      > JMPZ                                                     ~71, ->107
         97    >   INIT_FCALL                                               'str_pad'
         98        SEND_VAL                                                 0
         99        FETCH_DIM_R                                      ~72     !1, !0
        100        FETCH_DIM_R                                      ~73     ~72, 18
        101        FETCH_R                      local               ~74     ~73
        102        SEND_VAL                                                 ~74
        103        SEND_VAL                                                 '0'
        104        DO_ICALL                                         $75     
        105        QM_ASSIGN                                        ~76     $75
        106      > JMP                                                      ->108
        107    >   QM_ASSIGN                                        ~76     null
        108    >   FETCH_W                      local               $70     !5
        109        ASSIGN                                                   $70, ~76
        110    > > JMP                                                      ->126
   45   111    >   IS_EQUAL                                                 !6, 0
        112      > JMPZ                                                     ~79, ->123
        113    >   INIT_FCALL                                               'str_pad'
        114        SEND_VAL                                                 0
        115        FETCH_DIM_R                                      ~80     !1, !0
        116        FETCH_DIM_R                                      ~81     ~80, 18
        117        FETCH_R                      local               ~82     ~81
        118        SEND_VAL                                                 ~82
        119        SEND_VAL                                                 '0'
        120        DO_ICALL                                         $83     
        121        QM_ASSIGN                                        ~84     $83
        122      > JMP                                                      ->124
        123    >   QM_ASSIGN                                        ~84     null
        124    >   FETCH_W                      local               $78     !5
        125        ASSIGN                                                   $78, ~84
   17   126    > > JMP                                                      ->26
        127    >   FE_FREE                                                  $31
   49   128        TYPE_CHECK                                  1020          !8
        129      > JMPZ                                                     ~86, ->171
   51   130    >   IS_SMALLER                                       ~87     !8, !9
        131      > JMPZ_EX                                          ~87     ~87, ->143
        132    >   FETCH_DIM_R                                      ~88     !1, !0
        133        FETCH_DIM_R                                      ~89     ~88, 3
        134        FETCH_R                      local               ~90     ~89
        135        IS_SMALLER                                       ~91     ~90, !8
        136      > JMPNZ_EX                                         ~91     ~91, ->142
        137    >   FETCH_DIM_R                                      ~92     !1, !0
        138        FETCH_DIM_R                                      ~93     ~92, 3
        139        FETCH_R                      local               ~94     ~93
        140        IS_SMALLER                                       ~95     !9, ~94
        141        BOOL                                             ~91     ~95
        142    >   BOOL                                             ~87     ~91
        143    > > JMPNZ_EX                                         ~87     ~87, ->149
   53   144    >   FETCH_DIM_R                                      ~96     !1, !0
        145        FETCH_DIM_R                                      ~97     ~96, 3
        146        FETCH_R                      local               ~98     ~97
        147        IS_SMALLER                                       ~99     ~98, !9
        148        BOOL                                             ~87     ~99
        149    > > JMPNZ_EX                                         ~87     ~87, ->155
        150    >   FETCH_DIM_R                                      ~100    !1, !0
        151        FETCH_DIM_R                                      ~101    ~100, 3
        152        FETCH_R                      local               ~102    ~101
        153        IS_SMALLER                                       ~103    !8, ~102
        154        BOOL                                             ~87     ~103
        155    > > JMPZ                                                     ~87, ->170
   56   156    >   IS_SMALLER                                               !8, !9
        157      > JMPZ                                                     ~104, ->161
   57   158    >   ASSIGN                                                   !10, !9
   58   159        ASSIGN                                                   !9, !8
   59   160        ASSIGN                                                   !8, !10
   62   161    >   FETCH_DIM_R                                      ~108    !1, !0
        162        FETCH_DIM_R                                      ~109    ~108, 1
        163        CONCAT                                           ~110    'Le+champ+%27', ~109
        164        CONCAT                                           ~111    ~110, '%27+est+invalide%2C+la+valeur+doit+%C3%AAtre+comprise+entre+'
        165        CONCAT                                           ~112    ~111, !9
        166        CONCAT                                           ~113    ~112, '+et+'
        167        CONCAT                                           ~114    ~113, !8
        168        CONCAT                                           ~115    ~114, '+%21%3Cbr+%2F%3E'
        169        ASSIGN_OP                                     8          !11, ~115
        170    > > JMP                                                      ->185
   65   171    >   FETCH_DIM_R                                      ~117    !1, !0
        172        FETCH_DIM_R                                      ~118    ~117, 3
        173        FETCH_R                      local               ~119    ~118
        174        IS_SMALLER                                               ~119, !9
        175      > JMPZ                                                     ~120, ->185
   66   176    >   FETCH_DIM_R                                      ~121    !1, !0
        177        FETCH_DIM_R                                      ~122    ~121, 1
        178        CONCAT                                           ~123    'Le+champ+%27', ~122
        179        CONCAT                                           ~124    ~123, '%27+est+invalide%2C+la+valeur+doit+%C3%AAtre+comprise+entre+'
        180        CONCAT                                           ~125    ~124, !9
        181        CONCAT                                           ~126    ~125, '+et+'
        182        CONCAT                                           ~127    ~126, !8
        183        CONCAT                                           ~128    ~127, '+%21%3Cbr+%2F%3E'
        184        ASSIGN_OP                                     8          !11, ~128
   70   185    >   CONCAT                                           ~130    'Date+%3A+', !9
        186        CONCAT                                           ~131    ~130, '+-+'
        187        CONCAT                                           ~132    ~131, !8
        188        ECHO                                                     ~132
        189      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.17 ms | 1412 KiB | 27 Q