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, ", $ref); echo strftime("this week = %a $F, ", strtotime("this week", $ref)); echo strftime("next week = %a $F\n", strtotime("next week", $ref)); }
Output for 8.4.1 - 8.4.12
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 3 Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 7 Relative to Sat 2016-07-30, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 8 this week = Mon 2016-07-25, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 9 next week = Mon 2016-08-01 Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 7 Relative to Sun 2016-07-31, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 8 this week = Mon 2016-07-25, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 9 next week = Mon 2016-08-01 Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 7 Relative to Mon 2016-08-01, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 8 this week = Mon 2016-08-01, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 9 next week = Mon 2016-08-08 Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 7 Relative to Tue 2016-08-02, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 8 this week = Mon 2016-08-01, Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/nXoDJ on line 9 next week = Mon 2016-08-08
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25
Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 3 Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 7 Relative to Sat 2016-07-30, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 8 this week = Mon 2016-07-25, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 9 next week = Mon 2016-08-01 Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 7 Relative to Sun 2016-07-31, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 8 this week = Mon 2016-07-25, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 9 next week = Mon 2016-08-01 Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 7 Relative to Mon 2016-08-01, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 8 this week = Mon 2016-08-01, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 9 next week = Mon 2016-08-08 Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 7 Relative to Tue 2016-08-02, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 8 this week = Mon 2016-08-01, Deprecated: Function strftime() is deprecated in /in/nXoDJ on line 9 next week = Mon 2016-08-08
Output for 5.6.23 - 5.6.24, 7.0.8 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Relative to Sat 2016-07-30, this week = Mon 2016-07-25, next week = Mon 2016-08-01 Relative to Sun 2016-07-31, this week = Mon 2016-07-25, next week = Mon 2016-08-01 Relative to Mon 2016-08-01, this week = Mon 2016-08-01, next week = Mon 2016-08-08 Relative to Tue 2016-08-02, this week = Mon 2016-08-01, next week = Mon 2016-08-08
Output for 5.6.0 - 5.6.22, 7.0.0 - 7.0.7
Relative to Sat 2016-07-30, this week = Mon 2016-07-25, next week = Mon 2016-08-01 Relative to Sun 2016-07-31, this week = Mon 2016-08-01, next week = Mon 2016-08-08 Relative to Mon 2016-08-01, this week = Mon 2016-08-01, next week = Mon 2016-08-08 Relative to Tue 2016-08-02, this week = Mon 2016-08-01, next week = Mon 2016-08-08

preferences:
75.98 ms | 414 KiB | 5 Q