3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //echo strtotime('monday this week', time()); $dayOfWeek = ((int)date('N'))-1; $startOfWeek = date_modify(date_create(), '-'.$dayOfWeek); var_dump(date('d', $startOfWeek->getTimestamp()));
based on 6ZVXe
Output for 5.3.0 - 7.1.0
string(2) "22"
Output for 5.2.0 - 5.2.17
Fatal error: Call to a member function getTimestamp() on a non-object in /in/2ThpE on line 7
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function date_modify() in /in/2ThpE on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_modify() in /in/2ThpE on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_modify() in /in/2ThpE on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_modify() in /in/2ThpE on line 6