3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $format = 'd/m/Y'; foreach (range(1, 7) as $number) { $difference = date($format, strtotime('+' . $number . ' days')); $day = strtolower(date('l', $difference)); $$day = $difference; } $todayName = strtolower(date('l')); $$todayName = date($format); var_dump($monday); var_dump($tuesday); var_dump($wednesday); var_dump($thursday); var_dump($friday); var_dump($saturday); var_dump($sunday);
based on ZbrOX
Output for 5.1.0 - 7.2.0
Notice: A non well formed numeric value encountered in /in/LkSrl on line 7 Notice: A non well formed numeric value encountered in /in/LkSrl on line 7 Notice: A non well formed numeric value encountered in /in/LkSrl on line 7 Notice: A non well formed numeric value encountered in /in/LkSrl on line 7 Notice: A non well formed numeric value encountered in /in/LkSrl on line 7 Notice: A non well formed numeric value encountered in /in/LkSrl on line 7 Notice: A non well formed numeric value encountered in /in/LkSrl on line 7 Notice: Undefined variable: monday in /in/LkSrl on line 14 NULL Notice: Undefined variable: tuesday in /in/LkSrl on line 15 NULL Notice: Undefined variable: wednesday in /in/LkSrl on line 16 NULL string(10) "15/05/2015" string(10) "08/05/2015" Notice: Undefined variable: saturday in /in/LkSrl on line 19 NULL Notice: Undefined variable: sunday in /in/LkSrl on line 20 NULL
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: monday in /in/LkSrl on line 14 NULL Notice: Undefined variable: tuesday in /in/LkSrl on line 15 NULL Notice: Undefined variable: wednesday in /in/LkSrl on line 16 NULL string(10) "15/05/2015" string(10) "08/05/2015" Notice: Undefined variable: saturday in /in/LkSrl on line 19 NULL Notice: Undefined variable: sunday in /in/LkSrl on line 20 NULL
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: monday in /in/LkSrl on line 14 NULL Notice: Undefined variable: tuesday in /in/LkSrl on line 15 NULL Notice: Undefined variable: wednesday in /in/LkSrl on line 16 NULL string(10) "15/05/2015" string(10) "08/05/2015" Notice: Undefined variable: saturday in /in/LkSrl on line 19 NULL Notice: Undefined variable: sunday in /in/LkSrl on line 20 NULL