3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.36 ms | 1404 KiB | 27 Q