3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrformfields[$intj][3] = 'ok'; ${$arrformfields[$intj][3]} = '1990'; $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) // 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 && ${$arrformfields[$intj][3]} > $intyearstart)) OR ${$arrformfields[$intj][3]} < $intyearstart && ${$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"; } } } echo 'Date : '.$intyearstart.' - '.$intyearend;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 154
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 119
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 119
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 103
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 87
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 66
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 86
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
Branch analysis from position: 86
Branch analysis from position: 87
2 jumps found. (Code = 43) Position 1 = 89, Position 2 = 99
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 118
Branch analysis from position: 118
Branch analysis from position: 103
2 jumps found. (Code = 43) Position 1 = 105, Position 2 = 115
Branch analysis from position: 105
1 jumps found. (Code = 42) Position 1 = 116
Branch analysis from position: 116
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 115
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 119
2 jumps found. (Code = 43) Position 1 = 122, Position 2 = 154
Branch analysis from position: 122
2 jumps found. (Code = 46) Position 1 = 124, Position 2 = 135
Branch analysis from position: 124
2 jumps found. (Code = 46) Position 1 = 129, Position 2 = 134
Branch analysis from position: 129
2 jumps found. (Code = 47) Position 1 = 136, Position 2 = 147
Branch analysis from position: 136
2 jumps found. (Code = 46) Position 1 = 141, Position 2 = 146
Branch analysis from position: 141
2 jumps found. (Code = 43) Position 1 = 148, Position 2 = 154
Branch analysis from position: 148
2 jumps found. (Code = 43) Position 1 = 150, Position 2 = 153
Branch analysis from position: 150
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 153
Branch analysis from position: 154
Branch analysis from position: 146
Branch analysis from position: 147
Branch analysis from position: 134
Branch analysis from position: 135
Branch analysis from position: 154
Branch analysis from position: 119
Branch analysis from position: 154
filename:       /in/2mLpF
function name:  (null)
number of ops:  159
compiled vars:  !0 = $arrformfields, !1 = $intj, !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 >   FETCH_DIM_W                                      $11     !0, !1
          1        ASSIGN_DIM                                               $11, 3
          2        OP_DATA                                                  'ok'
    4     3        FETCH_DIM_R                                      ~13     !0, !1
          4        FETCH_DIM_R                                      ~14     ~13, 3
          5        FETCH_W                      local               $15     ~14
          6        ASSIGN                                                   $15, '1990'
    6     7        ASSIGN                                                   !2, 'qsd%3Bqsd'
    8     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%3B'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $18     
         12        ASSIGN                                                   !3, $18
   11    13        COUNT                                            ~20     !3
         14        IS_EQUAL                                                 ~20, 2
         15      > JMPZ                                                     ~21, ->154
   12    16    >   ASSIGN                                                   !4, <array>
   14    17      > FE_RESET_R                                       $23     !4, ->119
         18    > > FE_FETCH_R                                       ~24     $23, !5, ->119
         19    >   ASSIGN                                                   !6, ~24
   16    20        FETCH_DIM_R                                      ~26     !3, !6
         21        IS_NOT_EQUAL                                             ~26, ''
         22      > JMPZ                                                     ~27, ->103
   18    23    >   INIT_FCALL                                               'is_numeric'
         24        FETCH_DIM_R                                      ~28     !3, !6
         25        SEND_VAL                                                 ~28
         26        DO_ICALL                                         $29     
         27      > JMPZ                                                     $29, ->33
   20    28    >   FETCH_DIM_R                                      ~31     !3, !6
         29        CAST                                          4  ~32     ~31
         30        FETCH_W                      local               $30     !5
         31        ASSIGN                                                   $30, ~32
         32      > JMP                                                      ->102
   22    33    >   INIT_FCALL                                               'strpos'
         34        FETCH_DIM_R                                      ~34     !3, !6
         35        SEND_VAL                                                 ~34
         36        SEND_VAL                                                 'Y'
         37        DO_ICALL                                         $35     
         38        IS_IDENTICAL                                             $35, 0
         39      > JMPZ                                                     ~36, ->87
   24    40    >   INIT_FCALL                                               'date'
         41        SEND_VAL                                                 'Y'
         42        DO_ICALL                                         $38     
         43        FETCH_W                      local               $37     !5
         44        ASSIGN                                                   $37, $38
   26    45        INIT_FCALL                                               'strpos'
         46        FETCH_DIM_R                                      ~40     !3, !6
         47        SEND_VAL                                                 ~40
         48        SEND_VAL                                                 '%2B'
         49        DO_ICALL                                         $41     
         50        ASSIGN                                           ~42     !7, $41
         51        TYPE_CHECK                                  1018          ~42
         52      > JMPZ                                                     ~43, ->66
   28    53    >   INIT_FCALL                                               'trim'
         54        INIT_FCALL                                               'substr'
         55        FETCH_DIM_R                                      ~45     !3, !6
         56        SEND_VAL                                                 ~45
         57        ADD                                              ~46     !7, 1
         58        SEND_VAL                                                 ~46
         59        DO_ICALL                                         $47     
         60        SEND_VAR                                                 $47
         61        DO_ICALL                                         $48     
         62        CAST                                          4  ~49     $48
         63        FETCH_RW                     local               $44     !5
         64        ASSIGN_OP                                     1          $44, ~49
         65      > JMP                                                      ->86
   30    66    >   INIT_FCALL                                               'strpos'
         67        FETCH_DIM_R                                      ~51     !3, !6
         68        SEND_VAL                                                 ~51
         69        SEND_VAL                                                 '-'
         70        DO_ICALL                                         $52     
         71        ASSIGN                                           ~53     !7, $52
         72        TYPE_CHECK                                  1018          ~53
         73      > JMPZ                                                     ~54, ->86
   32    74    >   INIT_FCALL                                               'trim'
         75        INIT_FCALL                                               'substr'
         76        FETCH_DIM_R                                      ~56     !3, !6
         77        SEND_VAL                                                 ~56
         78        ADD                                              ~57     !7, 1
         79        SEND_VAL                                                 ~57
         80        DO_ICALL                                         $58     
         81        SEND_VAR                                                 $58
         82        DO_ICALL                                         $59     
         83        CAST                                          4  ~60     $59
         84        FETCH_RW                     local               $55     !5
         85        ASSIGN_OP                                     2          $55, ~60
         86    > > JMP                                                      ->102
   37    87    >   IS_EQUAL                                                 !6, 0
         88      > JMPZ                                                     ~63, ->99
         89    >   INIT_FCALL                                               'str_pad'
         90        SEND_VAL                                                 0
         91        FETCH_DIM_R                                      ~64     !0, !1
         92        FETCH_DIM_R                                      ~65     ~64, 18
         93        FETCH_R                      local               ~66     ~65
         94        SEND_VAL                                                 ~66
         95        SEND_VAL                                                 '0'
         96        DO_ICALL                                         $67     
         97        QM_ASSIGN                                        ~68     $67
         98      > JMP                                                      ->100
         99    >   QM_ASSIGN                                        ~68     null
        100    >   FETCH_W                      local               $62     !5
        101        ASSIGN                                                   $62, ~68
        102    > > JMP                                                      ->118
   42   103    >   IS_EQUAL                                                 !6, 0
        104      > JMPZ                                                     ~71, ->115
        105    >   INIT_FCALL                                               'str_pad'
        106        SEND_VAL                                                 0
        107        FETCH_DIM_R                                      ~72     !0, !1
        108        FETCH_DIM_R                                      ~73     ~72, 18
        109        FETCH_R                      local               ~74     ~73
        110        SEND_VAL                                                 ~74
        111        SEND_VAL                                                 '0'
        112        DO_ICALL                                         $75     
        113        QM_ASSIGN                                        ~76     $75
        114      > JMP                                                      ->116
        115    >   QM_ASSIGN                                        ~76     null
        116    >   FETCH_W                      local               $70     !5
        117        ASSIGN                                                   $70, ~76
   14   118    > > JMP                                                      ->18
        119    >   FE_FREE                                                  $23
   46   120        TYPE_CHECK                                  1020          !8
        121      > JMPZ                                                     ~78, ->154
   48   122    >   IS_SMALLER                                       ~79     !8, !9
        123      > JMPZ_EX                                          ~79     ~79, ->135
        124    >   FETCH_DIM_R                                      ~80     !0, !1
        125        FETCH_DIM_R                                      ~81     ~80, 3
        126        FETCH_R                      local               ~82     ~81
        127        IS_SMALLER                                       ~83     ~82, !8
        128      > JMPZ_EX                                          ~83     ~83, ->134
        129    >   FETCH_DIM_R                                      ~84     !0, !1
        130        FETCH_DIM_R                                      ~85     ~84, 3
        131        FETCH_R                      local               ~86     ~85
        132        IS_SMALLER                                       ~87     !9, ~86
        133        BOOL                                             ~83     ~87
        134    >   BOOL                                             ~79     ~83
        135    > > JMPNZ_EX                                         ~79     ~79, ->147
   50   136    >   FETCH_DIM_R                                      ~88     !0, !1
        137        FETCH_DIM_R                                      ~89     ~88, 3
        138        FETCH_R                      local               ~90     ~89
        139        IS_SMALLER                                       ~91     ~90, !9
        140      > JMPZ_EX                                          ~91     ~91, ->146
        141    >   FETCH_DIM_R                                      ~92     !0, !1
        142        FETCH_DIM_R                                      ~93     ~92, 3
        143        FETCH_R                      local               ~94     ~93
        144        IS_SMALLER                                       ~95     !8, ~94
        145        BOOL                                             ~91     ~95
        146    >   BOOL                                             ~79     ~91
        147    > > JMPZ                                                     ~79, ->154
   53   148    >   IS_SMALLER                                               !8, !9
        149      > JMPZ                                                     ~96, ->153
   54   150    >   ASSIGN                                                   !10, !9
   55   151        ASSIGN                                                   !9, !8
   56   152        ASSIGN                                                   !8, !10
   60   153    >   ECHO                                                     'Faux%0A%0A'
   65   154    >   CONCAT                                           ~100    'Date+%3A+', !9
        155        CONCAT                                           ~101    ~100, '+-+'
        156        CONCAT                                           ~102    ~101, !8
        157        ECHO                                                     ~102
        158      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.02 ms | 1412 KiB | 27 Q