3v4l.org

run code in 300+ PHP versions simultaneously
<?php function addDecalage($ts, $inverse = false) { $decalage = '3.0'; if ($decalage != 0) { if (!$inverse) $decalage = -$decalage; $ts_heureEte = strtotime("01 April " . date("Y", $ts)); $ts_heureEte_debut = strtotime("last sunday", $ts_heureEte); $ts_heureHiver = strtotime("01 November " . date("Y", $ts)); $ts_heureEte_fin = strtotime("last sunday", $ts_heureHiver); if ($ts > $ts_heureEte_debut && $ts < $ts_heureEte_fin) { if (!$inverse) $decalage = $decalage + 1; else $decalage = $decalage - 1; } $demiHeure = ""; if (preg_match("`[1-9]{1,2}\.0`", $decalage)) $decalage = substr($decalage, 0, strpos($decalage, ".")); if (preg_match("`[1-9]{1,2}\.5`", $decalage)) { $decalage = substr($decalage, 0, strpos($decalage, ".")); $demiHeure = " 30 minutes"; } if ($decalage > 0) $decalage = " +$decalage hours $demiHeure"; else $decalage = " $decalage hours $demiHeure"; return $new_ts = strtotime(date("Y-m-d H:i:s", $ts) . $decalage); } else return $ts; }$ts =1417086000;var_dump(date("Y-m-d H:i:s", addDecalage($ts)))?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fagbq
function name:  (null)
number of ops:  12
compiled vars:  !0 = $ts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ASSIGN                                                   !0, 1417086000
          1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
          4        INIT_FCALL                                               'adddecalage'
          5        SEND_VAR                                                 !0
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                         $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function adddecalage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 105
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 49
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 47
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 65
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 81
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 89
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 94
Branch analysis from position: 94
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 89
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 81
Branch analysis from position: 65
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 55, Position 2 = 65
Branch analysis from position: 55
Branch analysis from position: 65
Branch analysis from position: 49
Branch analysis from position: 41
Branch analysis from position: 9
Branch analysis from position: 105
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fagbq
function name:  addDecalage
number of ops:  107
compiled vars:  !0 = $ts, !1 = $inverse, !2 = $decalage, !3 = $ts_heureEte, !4 = $ts_heureEte_debut, !5 = $ts_heureHiver, !6 = $ts_heureEte_fin, !7 = $demiHeure, !8 = $new_ts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <false>
          2        ASSIGN                                                   !2, '3.0'
          3        IS_NOT_EQUAL                                             !2, 0
          4      > JMPZ                                                     ~10, ->105
          5    >   BOOL_NOT                                         ~11     !1
          6      > JMPZ                                                     ~11, ->9
          7    >   MUL                                              ~12     !2, -1
          8        ASSIGN                                                   !2, ~12
          9    >   INIT_FCALL                                               'strtotime'
         10        INIT_FCALL                                               'date'
         11        SEND_VAL                                                 'Y'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $14     
         14        CONCAT                                           ~15     '01+April+', $14
         15        SEND_VAL                                                 ~15
         16        DO_ICALL                                         $16     
         17        ASSIGN                                                   !3, $16
         18        INIT_FCALL                                               'strtotime'
         19        SEND_VAL                                                 'last+sunday'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $18     
         22        ASSIGN                                                   !4, $18
         23        INIT_FCALL                                               'strtotime'
         24        INIT_FCALL                                               'date'
         25        SEND_VAL                                                 'Y'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $20     
         28        CONCAT                                           ~21     '01+November+', $20
         29        SEND_VAL                                                 ~21
         30        DO_ICALL                                         $22     
         31        ASSIGN                                                   !5, $22
         32        INIT_FCALL                                               'strtotime'
         33        SEND_VAL                                                 'last+sunday'
         34        SEND_VAR                                                 !5
         35        DO_ICALL                                         $24     
         36        ASSIGN                                                   !6, $24
         37        IS_SMALLER                                       ~26     !4, !0
         38      > JMPZ_EX                                          ~26     ~26, ->41
         39    >   IS_SMALLER                                       ~27     !0, !6
         40        BOOL                                             ~26     ~27
         41    > > JMPZ                                                     ~26, ->49
         42    >   BOOL_NOT                                         ~28     !1
         43      > JMPZ                                                     ~28, ->47
         44    >   ADD                                              ~29     !2, 1
         45        ASSIGN                                                   !2, ~29
         46      > JMP                                                      ->49
         47    >   SUB                                              ~31     !2, 1
         48        ASSIGN                                                   !2, ~31
         49    >   ASSIGN                                                   !7, ''
         50        INIT_FCALL                                               'preg_match'
         51        SEND_VAL                                                 '%60%5B1-9%5D%7B1%2C2%7D%5C.0%60'
         52        SEND_VAR                                                 !2
         53        DO_ICALL                                         $34     
         54      > JMPZ                                                     $34, ->65
         55    >   INIT_FCALL                                               'substr'
         56        SEND_VAR                                                 !2
         57        SEND_VAL                                                 0
         58        INIT_FCALL                                               'strpos'
         59        SEND_VAR                                                 !2
         60        SEND_VAL                                                 '.'
         61        DO_ICALL                                         $35     
         62        SEND_VAR                                                 $35
         63        DO_ICALL                                         $36     
         64        ASSIGN                                                   !2, $36
         65    >   INIT_FCALL                                               'preg_match'
         66        SEND_VAL                                                 '%60%5B1-9%5D%7B1%2C2%7D%5C.5%60'
         67        SEND_VAR                                                 !2
         68        DO_ICALL                                         $38     
         69      > JMPZ                                                     $38, ->81
         70    >   INIT_FCALL                                               'substr'
         71        SEND_VAR                                                 !2
         72        SEND_VAL                                                 0
         73        INIT_FCALL                                               'strpos'
         74        SEND_VAR                                                 !2
         75        SEND_VAL                                                 '.'
         76        DO_ICALL                                         $39     
         77        SEND_VAR                                                 $39
         78        DO_ICALL                                         $40     
         79        ASSIGN                                                   !2, $40
         80        ASSIGN                                                   !7, '+30+minutes'
         81    >   IS_SMALLER                                               0, !2
         82      > JMPZ                                                     ~43, ->89
         83    >   ROPE_INIT                                     4  ~45     '+%2B'
         84        ROPE_ADD                                      1  ~45     ~45, !2
         85        ROPE_ADD                                      2  ~45     ~45, '+hours+'
         86        ROPE_END                                      3  ~44     ~45, !7
         87        ASSIGN                                                   !2, ~44
         88      > JMP                                                      ->94
         89    >   ROPE_INIT                                     4  ~49     '+'
         90        ROPE_ADD                                      1  ~49     ~49, !2
         91        ROPE_ADD                                      2  ~49     ~49, '+hours+'
         92        ROPE_END                                      3  ~48     ~49, !7
         93        ASSIGN                                                   !2, ~48
         94    >   INIT_FCALL                                               'strtotime'
         95        INIT_FCALL                                               'date'
         96        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
         97        SEND_VAR                                                 !0
         98        DO_ICALL                                         $52     
         99        CONCAT                                           ~53     $52, !2
        100        SEND_VAL                                                 ~53
        101        DO_ICALL                                         $54     
        102        ASSIGN                                           ~55     !8, $54
        103      > RETURN                                                   ~55
        104*       JMP                                                      ->106
        105    > > RETURN                                                   !0
        106*     > RETURN                                                   null

End of function adddecalage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.15 ms | 1406 KiB | 26 Q