3v4l.org

run code in 300+ PHP versions simultaneously
<?php $F = strftime("%F") ? "%F" : "%Y-%m-%d"; foreach (array("Sat 2016-07-30", "Sun 2016-07-31", "Mon 2016-08-01", "Tue 2016-08-02") as $ref) { $ref = strtotime($ref); echo strftime("Relative to %a $F\n", $ref); foreach (array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun") as $day) { echo strftime("{$day} next week = %a $F\t", strtotime("{$day} next week", $ref)); echo strftime("next week {$day} = %a $F\n", strtotime("next week {$day}", $ref)); } echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 59
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 59
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 56
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 56
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 56
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 59
Branch analysis from position: 9
Branch analysis from position: 59
filename:       /in/XtSCi
function name:  (null)
number of ops:  61
compiled vars:  !0 = $F, !1 = $ref, !2 = $day
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'strftime'
          1        SEND_VAL                                                 '%25F'
          2        DO_ICALL                                         $3      
          3      > JMPZ                                                     $3, ->6
          4    >   QM_ASSIGN                                        ~4      '%25F'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      '%25Y-%25m-%25d'
          7    >   ASSIGN                                                   !0, ~4
    5     8      > FE_RESET_R                                       $6      <array>, ->59
          9    > > FE_FETCH_R                                               $6, !1, ->59
    6    10    >   INIT_FCALL                                               'strtotime'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !1, $7
    7    14        INIT_FCALL                                               'strftime'
         15        ROPE_INIT                                     3  ~10     'Relative+to+%25a+'
         16        ROPE_ADD                                      1  ~10     ~10, !0
         17        ROPE_END                                      2  ~9      ~10, '%0A'
         18        SEND_VAL                                                 ~9
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $12     
         21        ECHO                                                     $12
    9    22      > FE_RESET_R                                       $13     <array>, ->56
         23    > > FE_FETCH_R                                               $13, !2, ->56
   10    24    >   INIT_FCALL                                               'strftime'
         25        ROPE_INIT                                     4  ~15     !2
         26        ROPE_ADD                                      1  ~15     ~15, '+next+week+%3D+%25a+'
         27        ROPE_ADD                                      2  ~15     ~15, !0
         28        ROPE_END                                      3  ~14     ~15, '%09'
         29        SEND_VAL                                                 ~14
         30        INIT_FCALL                                               'strtotime'
         31        NOP                                                      
         32        FAST_CONCAT                                      ~17     !2, '+next+week'
         33        SEND_VAL                                                 ~17
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                         $18     
         36        SEND_VAR                                                 $18
         37        DO_ICALL                                         $19     
         38        ECHO                                                     $19
   11    39        INIT_FCALL                                               'strftime'
         40        ROPE_INIT                                     5  ~21     'next+week+'
         41        ROPE_ADD                                      1  ~21     ~21, !2
         42        ROPE_ADD                                      2  ~21     ~21, '+%3D+%25a+'
         43        ROPE_ADD                                      3  ~21     ~21, !0
         44        ROPE_END                                      4  ~20     ~21, '%0A'
         45        SEND_VAL                                                 ~20
         46        INIT_FCALL                                               'strtotime'
         47        NOP                                                      
         48        FAST_CONCAT                                      ~24     'next+week+', !2
         49        SEND_VAL                                                 ~24
         50        SEND_VAR                                                 !1
         51        DO_ICALL                                         $25     
         52        SEND_VAR                                                 $25
         53        DO_ICALL                                         $26     
         54        ECHO                                                     $26
    9    55      > JMP                                                      ->23
         56    >   FE_FREE                                                  $13
   14    57        ECHO                                                     '%0A'
    5    58      > JMP                                                      ->9
         59    >   FE_FREE                                                  $6
   15    60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.76 ms | 945 KiB | 18 Q