3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo $wk_baseline = date('w', strtotime('01/01/2016')) + 1 . "\n"; echo ceil(max(date('z', strtotime("1/1/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/2/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/3/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/4/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/8/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/9/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/20/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/21/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/22/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("1/23/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; echo ceil(max(date('z', strtotime("2/14/2016")) - (7 - $wk_baseline),0) / 7) . "\n"; ?>
based on RstVg
Output for 7.1.0 - 7.3.0alpha1
6 Notice: A non well formed numeric value encountered in /in/Gui9V on line 3 0 Notice: A non well formed numeric value encountered in /in/Gui9V on line 4 0 Notice: A non well formed numeric value encountered in /in/Gui9V on line 5 1 Notice: A non well formed numeric value encountered in /in/Gui9V on line 6 1 Notice: A non well formed numeric value encountered in /in/Gui9V on line 7 1 Notice: A non well formed numeric value encountered in /in/Gui9V on line 8 1 Notice: A non well formed numeric value encountered in /in/Gui9V on line 9 3 Notice: A non well formed numeric value encountered in /in/Gui9V on line 10 3 Notice: A non well formed numeric value encountered in /in/Gui9V on line 11 3 Notice: A non well formed numeric value encountered in /in/Gui9V on line 12 3 Notice: A non well formed numeric value encountered in /in/Gui9V on line 13 7
Output for 5.5.0 - 7.0.20
6 0 0 1 1 1 1 3 3 3 3 7