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((new DateTime()), '-'.$dayOfWeek); var_dump(date('d', $startOfWeek->getTimestamp()));
based on vJkSU
Output for 5.3.0 - 5.6.24, 7.0.0 - 7.1.0
string(2) "22"
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function getTimestamp() on a non-object (null)' in /in/1fns9:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Fatal error: Call to a member function getTimestamp() on a non-object in /in/1fns9 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/1fns9 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/1fns9 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/1fns9 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/1fns9 on line 6