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; } var_dump($decalage); $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"; } var_dump($decalage); 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/3CIu6
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 = 111
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 = 58, Position 2 = 68
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 73, Position 2 = 84
Branch analysis from position: 73
2 jumps found. (Code = 43) Position 1 = 89, Position 2 = 95
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 100
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 95
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 84
Branch analysis from position: 68
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 68
Branch analysis from position: 58
Branch analysis from position: 68
Branch analysis from position: 49
Branch analysis from position: 41
Branch analysis from position: 9
Branch analysis from position: 111
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3CIu6
function name:  addDecalage
number of ops:  113
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, ->111
          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    >   INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !2
         51        DO_ICALL                                                 
         52        ASSIGN                                                   !7, ''
         53        INIT_FCALL                                               'preg_match'
         54        SEND_VAL                                                 '%60%5B1-9%5D%7B1%2C2%7D%5C.0%60'
         55        SEND_VAR                                                 !2
         56        DO_ICALL                                         $35     
         57      > JMPZ                                                     $35, ->68
         58    >   INIT_FCALL                                               'substr'
         59        SEND_VAR                                                 !2
         60        SEND_VAL                                                 0
         61        INIT_FCALL                                               'strpos'
         62        SEND_VAR                                                 !2
         63        SEND_VAL                                                 '.'
         64        DO_ICALL                                         $36     
         65        SEND_VAR                                                 $36
         66        DO_ICALL                                         $37     
         67        ASSIGN                                                   !2, $37
         68    >   INIT_FCALL                                               'preg_match'
         69        SEND_VAL                                                 '%60%5B1-9%5D%7B1%2C2%7D%5C.5%60'
         70        SEND_VAR                                                 !2
         71        DO_ICALL                                         $39     
         72      > JMPZ                                                     $39, ->84
         73    >   INIT_FCALL                                               'substr'
         74        SEND_VAR                                                 !2
         75        SEND_VAL                                                 0
         76        INIT_FCALL                                               'strpos'
         77        SEND_VAR                                                 !2
         78        SEND_VAL                                                 '.'
         79        DO_ICALL                                         $40     
         80        SEND_VAR                                                 $40
         81        DO_ICALL                                         $41     
         82        ASSIGN                                                   !2, $41
         83        ASSIGN                                                   !7, '+30+minutes'
         84    >   INIT_FCALL                                               'var_dump'
         85        SEND_VAR                                                 !2
         86        DO_ICALL                                                 
         87        IS_SMALLER                                               0, !2
         88      > JMPZ                                                     ~45, ->95
         89    >   ROPE_INIT                                     4  ~47     '+%2B'
         90        ROPE_ADD                                      1  ~47     ~47, !2
         91        ROPE_ADD                                      2  ~47     ~47, '+hours+'
         92        ROPE_END                                      3  ~46     ~47, !7
         93        ASSIGN                                                   !2, ~46
         94      > JMP                                                      ->100
         95    >   ROPE_INIT                                     4  ~51     '+'
         96        ROPE_ADD                                      1  ~51     ~51, !2
         97        ROPE_ADD                                      2  ~51     ~51, '+hours+'
         98        ROPE_END                                      3  ~50     ~51, !7
         99        ASSIGN                                                   !2, ~50
        100    >   INIT_FCALL                                               'strtotime'
        101        INIT_FCALL                                               'date'
        102        SEND_VAL                                                 'Y-m-d+H%3Ai%3As'
        103        SEND_VAR                                                 !0
        104        DO_ICALL                                         $54     
        105        CONCAT                                           ~55     $54, !2
        106        SEND_VAL                                                 ~55
        107        DO_ICALL                                         $56     
        108        ASSIGN                                           ~57     !8, $56
        109      > RETURN                                                   ~57
        110*       JMP                                                      ->112
        111    > > RETURN                                                   !0
        112*     > RETURN                                                   null

End of function adddecalage

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.51 ms | 1402 KiB | 26 Q