3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $input = new \DateTime('2017-07-17'); $firstDayOfMonth = new \DateTime($input->format('Y-m-01')); $order = (int)($input->format('n') / 7) + 1; if ($input->format('N') < $firstDayOfMonth->format('N')) $order++; var_dump($input->format('l')); var_dump($order);
Output for 5.6.30, hhvm-3.15.4 - 3.22.0, 7.0.0 - 7.2.9
string(6) "Monday" int(3)