3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
191.84 ms | 1412 KiB | 27 Q