3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = 'Y + 10;'; $arrvalidrules = explode(';', $value); // On vérifie qu'il n'y bien que deux valeurs. if (count($arrvalidrules) == 2) { $intyearend = null; if ($arrvalidrules[0]!='') { if (is_numeric($arrvalidrules[0])) { $intyearstart=intval($arrvalidrules[0]); } else if (strpos($arrvalidrules[0], 'Y') === 0) { $intyearstart = date('Y'); if (($intsignpos = strpos($arrvalidrules[0], '+')) !== false) { echo 'Test:'.substr($arrvalidrules[0], $intsignpos+1); $intyearstart += (int) (trim(substr($arrvalidrules[0], $intsignpos+1))); } else if (($intsignpos = strpos($arrvalidrules[0], '-')) !== false) { $intyearstart -= (int) (trim(substr($arrvalidrules[0], $intsignpos+1))); } } else { $intyearstart = false; } } else { $intyearstart = 0; } } echo 'Date : '.$intyearstart.' - '.$intyearend;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 84
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 83
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 82
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 81
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 61
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
1 jumps found. (Code = 42) Position 1 = 82
Branch analysis from position: 82
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 80
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 82
Branch analysis from position: 82
Branch analysis from position: 80
Branch analysis from position: 81
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
Branch analysis from position: 83
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 84
filename:       /in/NttlC
function name:  (null)
number of ops:  89
compiled vars:  !0 = $value, !1 = $arrvalidrules, !2 = $intyearend, !3 = $intyearstart, !4 = $intsignpos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Y+%2B+10%3B'
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%3B'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    8     6        COUNT                                            ~8      !1
          7        IS_EQUAL                                                 ~8, 2
          8      > JMPZ                                                     ~9, ->84
    9     9    >   ASSIGN                                                   !2, null
   11    10        FETCH_DIM_R                                      ~11     !1, 0
         11        IS_NOT_EQUAL                                             ~11, ''
         12      > JMPZ                                                     ~12, ->83
   12    13    >   INIT_FCALL                                               'is_numeric'
         14        FETCH_DIM_R                                      ~13     !1, 0
         15        SEND_VAL                                                 ~13
         16        DO_ICALL                                         $14     
         17      > JMPZ                                                     $14, ->22
   13    18    >   FETCH_DIM_R                                      ~15     !1, 0
         19        CAST                                          4  ~16     ~15
         20        ASSIGN                                                   !3, ~16
         21      > JMP                                                      ->82
   15    22    >   INIT_FCALL                                               'strpos'
         23        FETCH_DIM_R                                      ~18     !1, 0
         24        SEND_VAL                                                 ~18
         25        SEND_VAL                                                 'Y'
         26        DO_ICALL                                         $19     
         27        IS_IDENTICAL                                             $19, 0
         28      > JMPZ                                                     ~20, ->81
   16    29    >   INIT_FCALL                                               'date'
         30        SEND_VAL                                                 'Y'
         31        DO_ICALL                                         $21     
         32        ASSIGN                                                   !3, $21
   18    33        INIT_FCALL                                               'strpos'
         34        FETCH_DIM_R                                      ~23     !1, 0
         35        SEND_VAL                                                 ~23
         36        SEND_VAL                                                 '%2B'
         37        DO_ICALL                                         $24     
         38        ASSIGN                                           ~25     !4, $24
         39        TYPE_CHECK                                  1018          ~25
         40      > JMPZ                                                     ~26, ->61
   19    41    >   INIT_FCALL                                               'substr'
         42        FETCH_DIM_R                                      ~27     !1, 0
         43        SEND_VAL                                                 ~27
         44        ADD                                              ~28     !4, 1
         45        SEND_VAL                                                 ~28
         46        DO_ICALL                                         $29     
         47        CONCAT                                           ~30     'Test%3A', $29
         48        ECHO                                                     ~30
   20    49        INIT_FCALL                                               'trim'
         50        INIT_FCALL                                               'substr'
         51        FETCH_DIM_R                                      ~31     !1, 0
         52        SEND_VAL                                                 ~31
         53        ADD                                              ~32     !4, 1
         54        SEND_VAL                                                 ~32
         55        DO_ICALL                                         $33     
         56        SEND_VAR                                                 $33
         57        DO_ICALL                                         $34     
         58        CAST                                          4  ~35     $34
         59        ASSIGN_OP                                     1          !3, ~35
         60      > JMP                                                      ->80
   22    61    >   INIT_FCALL                                               'strpos'
         62        FETCH_DIM_R                                      ~37     !1, 0
         63        SEND_VAL                                                 ~37
         64        SEND_VAL                                                 '-'
         65        DO_ICALL                                         $38     
         66        ASSIGN                                           ~39     !4, $38
         67        TYPE_CHECK                                  1018          ~39
         68      > JMPZ                                                     ~40, ->80
   23    69    >   INIT_FCALL                                               'trim'
         70        INIT_FCALL                                               'substr'
         71        FETCH_DIM_R                                      ~41     !1, 0
         72        SEND_VAL                                                 ~41
         73        ADD                                              ~42     !4, 1
         74        SEND_VAL                                                 ~42
         75        DO_ICALL                                         $43     
         76        SEND_VAR                                                 $43
         77        DO_ICALL                                         $44     
         78        CAST                                          4  ~45     $44
         79        ASSIGN_OP                                     2          !3, ~45
         80    > > JMP                                                      ->82
   27    81    >   ASSIGN                                                   !3, <false>
         82    > > JMP                                                      ->84
   31    83    >   ASSIGN                                                   !3, 0
   35    84    >   CONCAT                                           ~49     'Date+%3A+', !3
         85        CONCAT                                           ~50     ~49, '+-+'
         86        CONCAT                                           ~51     ~50, !2
         87        ECHO                                                     ~51
         88      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.9 ms | 1404 KiB | 25 Q