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) { $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 = 76
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 75
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 = 74
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 73
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 53
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 72
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 72
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 72
Branch analysis from position: 73
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 76
filename:       /in/2bK8r
function name:  (null)
number of ops:  81
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, ->76
    9     9    >   ASSIGN                                                   !2, null
   11    10        FETCH_DIM_R                                      ~11     !1, 0
         11        IS_NOT_EQUAL                                             ~11, ''
         12      > JMPZ                                                     ~12, ->75
   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                                                      ->74
   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, ->73
   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, ->53
   19    41    >   INIT_FCALL                                               'trim'
         42        INIT_FCALL                                               'substr'
         43        FETCH_DIM_R                                      ~27     !1, 0
         44        SEND_VAL                                                 ~27
         45        ADD                                              ~28     !4, 1
         46        SEND_VAL                                                 ~28
         47        DO_ICALL                                         $29     
         48        SEND_VAR                                                 $29
         49        DO_ICALL                                         $30     
         50        CAST                                          4  ~31     $30
         51        ASSIGN_OP                                     1          !3, ~31
         52      > JMP                                                      ->72
   21    53    >   INIT_FCALL                                               'strpos'
         54        FETCH_DIM_R                                      ~33     !1, 0
         55        SEND_VAL                                                 ~33
         56        SEND_VAL                                                 '-'
         57        DO_ICALL                                         $34     
         58        ASSIGN                                           ~35     !4, $34
         59        TYPE_CHECK                                  1018          ~35
         60      > JMPZ                                                     ~36, ->72
   22    61    >   INIT_FCALL                                               'trim'
         62        INIT_FCALL                                               'substr'
         63        FETCH_DIM_R                                      ~37     !1, 0
         64        SEND_VAL                                                 ~37
         65        ADD                                              ~38     !4, 1
         66        SEND_VAL                                                 ~38
         67        DO_ICALL                                         $39     
         68        SEND_VAR                                                 $39
         69        DO_ICALL                                         $40     
         70        CAST                                          4  ~41     $40
         71        ASSIGN_OP                                     2          !3, ~41
         72    > > JMP                                                      ->74
   26    73    >   ASSIGN                                                   !3, <false>
         74    > > JMP                                                      ->76
   30    75    >   ASSIGN                                                   !3, 0
   34    76    >   CONCAT                                           ~45     'Date+%3A+', !3
         77        CONCAT                                           ~46     ~45, '+-+'
         78        CONCAT                                           ~47     ~46, !2
         79        ECHO                                                     ~47
         80      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.19 ms | 1396 KiB | 25 Q