3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); $navDays = [ '-7Days' => (new DateTime())->modify('-7 days')->format('Y-m-d'), '-1Day' => (new DateTime())->modify('-1 days')->format('Y-m-d'), 'Today' => (new DateTime())->format('Y-m-d'), '+1Day' => (new DateTime())->modify('+1 days')->format('Y-m-d'), '+7Days' => (new DateTime())->modify('+7 days')->format('Y-m-d') ]; var_dump($navDays);
based on Bic7S
Output for 5.4.11 - 5.4.45, 7.0.20 - 7.2.0
array(5) { ["-7Days"]=> string(10) "2015-12-15" ["-1Day"]=> string(10) "2015-12-21" ["Today"]=> string(10) "2015-12-22" ["+1Day"]=> string(10) "2015-12-23" ["+7Days"]=> string(10) "2015-12-29" }
Output for 7.0.6
array(5) { ["-7Days"]=> string(10) "2016-05-14" ["-1Day"]=> string(10) "2016-05-20" ["Today"]=> string(10) "2016-05-21" ["+1Day"]=> string(10) "2016-05-22" ["+7Days"]=> string(10) "2016-05-28" }
Output for 7.0.5
array(5) { ["-7Days"]=> string(10) "2016-03-27" ["-1Day"]=> string(10) "2016-04-02" ["Today"]=> string(10) "2016-04-03" ["+1Day"]=> string(10) "2016-04-04" ["+7Days"]=> string(10) "2016-04-10" }
Output for 7.0.4
array(5) { ["-7Days"]=> string(10) "2016-03-03" ["-1Day"]=> string(10) "2016-03-09" ["Today"]=> string(10) "2016-03-10" ["+1Day"]=> string(10) "2016-03-11" ["+7Days"]=> string(10) "2016-03-17" }
Output for 7.0.3
array(5) { ["-7Days"]=> string(10) "2016-03-11" ["-1Day"]=> string(10) "2016-03-17" ["Today"]=> string(10) "2016-03-18" ["+1Day"]=> string(10) "2016-03-19" ["+7Days"]=> string(10) "2016-03-25" }
Output for 7.0.2
array(5) { ["-7Days"]=> string(10) "2016-03-16" ["-1Day"]=> string(10) "2016-03-22" ["Today"]=> string(10) "2016-03-23" ["+1Day"]=> string(10) "2016-03-24" ["+7Days"]=> string(10) "2016-03-30" }
Output for 7.0.1
array(5) { ["-7Days"]=> string(10) "2016-03-17" ["-1Day"]=> string(10) "2016-03-23" ["Today"]=> string(10) "2016-03-24" ["+1Day"]=> string(10) "2016-03-25" ["+7Days"]=> string(10) "2016-03-31" }
Output for 7.0.0
array(5) { ["-7Days"]=> string(10) "2016-03-20" ["-1Day"]=> string(10) "2016-03-26" ["Today"]=> string(10) "2016-03-27" ["+1Day"]=> string(10) "2016-03-28" ["+7Days"]=> string(10) "2016-04-03" }
Output for 5.6.21
array(5) { ["-7Days"]=> string(10) "2016-04-25" ["-1Day"]=> string(10) "2016-05-01" ["Today"]=> string(10) "2016-05-02" ["+1Day"]=> string(10) "2016-05-03" ["+7Days"]=> string(10) "2016-05-09" }
Output for 5.6.20
array(5) { ["-7Days"]=> string(10) "2016-04-03" ["-1Day"]=> string(10) "2016-04-09" ["Today"]=> string(10) "2016-04-10" ["+1Day"]=> string(10) "2016-04-11" ["+7Days"]=> string(10) "2016-04-17" }
Output for 5.6.19
array(5) { ["-7Days"]=> string(10) "2016-03-01" ["-1Day"]=> string(10) "2016-03-07" ["Today"]=> string(10) "2016-03-08" ["+1Day"]=> string(10) "2016-03-09" ["+7Days"]=> string(10) "2016-03-15" }
Output for 5.6.18
array(5) { ["-7Days"]=> string(10) "2016-03-08" ["-1Day"]=> string(10) "2016-03-14" ["Today"]=> string(10) "2016-03-15" ["+1Day"]=> string(10) "2016-03-16" ["+7Days"]=> string(10) "2016-03-22" }
Output for 5.6.17
array(5) { ["-7Days"]=> string(10) "2016-03-13" ["-1Day"]=> string(10) "2016-03-19" ["Today"]=> string(10) "2016-03-20" ["+1Day"]=> string(10) "2016-03-21" ["+7Days"]=> string(10) "2016-03-27" }
Output for 5.6.16
array(5) { ["-7Days"]=> string(10) "2016-03-21" ["-1Day"]=> string(10) "2016-03-27" ["Today"]=> string(10) "2016-03-28" ["+1Day"]=> string(10) "2016-03-29" ["+7Days"]=> string(10) "2016-04-04" }
Output for 5.6.15
array(5) { ["-7Days"]=> string(10) "2016-03-22" ["-1Day"]=> string(10) "2016-03-28" ["Today"]=> string(10) "2016-03-29" ["+1Day"]=> string(10) "2016-03-30" ["+7Days"]=> string(10) "2016-04-05" }
Output for 5.6.14
array(5) { ["-7Days"]=> string(10) "2016-04-07" ["-1Day"]=> string(10) "2016-04-13" ["Today"]=> string(10) "2016-04-14" ["+1Day"]=> string(10) "2016-04-15" ["+7Days"]=> string(10) "2016-04-21" }
Output for 5.6.13
array(5) { ["-7Days"]=> string(10) "2016-04-08" ["-1Day"]=> string(10) "2016-04-14" ["Today"]=> string(10) "2016-04-15" ["+1Day"]=> string(10) "2016-04-16" ["+7Days"]=> string(10) "2016-04-22" }
Output for 5.6.12
array(5) { ["-7Days"]=> string(10) "2016-04-13" ["-1Day"]=> string(10) "2016-04-19" ["Today"]=> string(10) "2016-04-20" ["+1Day"]=> string(10) "2016-04-21" ["+7Days"]=> string(10) "2016-04-27" }
Output for 5.6.11
array(5) { ["-7Days"]=> string(10) "2016-04-17" ["-1Day"]=> string(10) "2016-04-23" ["Today"]=> string(10) "2016-04-24" ["+1Day"]=> string(10) "2016-04-25" ["+7Days"]=> string(10) "2016-05-01" }
Output for 5.6.10
array(5) { ["-7Days"]=> string(10) "2016-04-18" ["-1Day"]=> string(10) "2016-04-24" ["Today"]=> string(10) "2016-04-25" ["+1Day"]=> string(10) "2016-04-26" ["+7Days"]=> string(10) "2016-05-02" }
Output for 5.6.9
array(5) { ["-7Days"]=> string(10) "2016-04-20" ["-1Day"]=> string(10) "2016-04-26" ["Today"]=> string(10) "2016-04-27" ["+1Day"]=> string(10) "2016-04-28" ["+7Days"]=> string(10) "2016-05-04" }
Output for 5.6.8
array(5) { ["-7Days"]=> string(10) "2016-04-23" ["-1Day"]=> string(10) "2016-04-29" ["Today"]=> string(10) "2016-04-30" ["+1Day"]=> string(10) "2016-05-01" ["+7Days"]=> string(10) "2016-05-07" }
Output for 5.5.35
array(5) { ["-7Days"]=> string(10) "2016-05-16" ["-1Day"]=> string(10) "2016-05-22" ["Today"]=> string(10) "2016-05-23" ["+1Day"]=> string(10) "2016-05-24" ["+7Days"]=> string(10) "2016-05-30" }
Output for 5.5.34
array(5) { ["-7Days"]=> string(10) "2016-04-04" ["-1Day"]=> string(10) "2016-04-10" ["Today"]=> string(10) "2016-04-11" ["+1Day"]=> string(10) "2016-04-12" ["+7Days"]=> string(10) "2016-04-18" }
Output for 5.5.33
array(5) { ["-7Days"]=> string(10) "2016-03-02" ["-1Day"]=> string(10) "2016-03-08" ["Today"]=> string(10) "2016-03-09" ["+1Day"]=> string(10) "2016-03-10" ["+7Days"]=> string(10) "2016-03-16" }
Output for 5.5.32
array(5) { ["-7Days"]=> string(10) "2016-03-10" ["-1Day"]=> string(10) "2016-03-16" ["Today"]=> string(10) "2016-03-17" ["+1Day"]=> string(10) "2016-03-18" ["+7Days"]=> string(10) "2016-03-24" }
Output for 5.5.31
array(5) { ["-7Days"]=> string(10) "2016-03-14" ["-1Day"]=> string(10) "2016-03-20" ["Today"]=> string(10) "2016-03-21" ["+1Day"]=> string(10) "2016-03-22" ["+7Days"]=> string(10) "2016-03-28" }
Output for 5.5.30
array(5) { ["-7Days"]=> string(10) "2016-03-25" ["-1Day"]=> string(10) "2016-03-31" ["Today"]=> string(10) "2016-04-01" ["+1Day"]=> string(10) "2016-04-02" ["+7Days"]=> string(10) "2016-04-08" }
Output for 5.5.29
array(5) { ["-7Days"]=> string(10) "2016-04-10" ["-1Day"]=> string(10) "2016-04-16" ["Today"]=> string(10) "2016-04-17" ["+1Day"]=> string(10) "2016-04-18" ["+7Days"]=> string(10) "2016-04-24" }
Output for 5.5.28
array(5) { ["-7Days"]=> string(10) "2016-04-14" ["-1Day"]=> string(10) "2016-04-20" ["Today"]=> string(10) "2016-04-21" ["+1Day"]=> string(10) "2016-04-22" ["+7Days"]=> string(10) "2016-04-28" }
Output for 5.5.27
array(5) { ["-7Days"]=> string(10) "2016-04-15" ["-1Day"]=> string(10) "2016-04-21" ["Today"]=> string(10) "2016-04-22" ["+1Day"]=> string(10) "2016-04-23" ["+7Days"]=> string(10) "2016-04-29" }
Output for 5.5.26
array(5) { ["-7Days"]=> string(10) "2016-04-19" ["-1Day"]=> string(10) "2016-04-25" ["Today"]=> string(10) "2016-04-26" ["+1Day"]=> string(10) "2016-04-27" ["+7Days"]=> string(10) "2016-05-03" }
Output for 5.5.25
array(5) { ["-7Days"]=> string(10) "2016-04-22" ["-1Day"]=> string(10) "2016-04-28" ["Today"]=> string(10) "2016-04-29" ["+1Day"]=> string(10) "2016-04-30" ["+7Days"]=> string(10) "2016-05-06" }
Output for 5.5.24
array(5) { ["-7Days"]=> string(10) "2016-05-17" ["-1Day"]=> string(10) "2016-05-23" ["Today"]=> string(10) "2016-05-24" ["+1Day"]=> string(10) "2016-05-25" ["+7Days"]=> string(10) "2016-05-31" }
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/CE1Te on line 7
Process exited with code 255.