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(time()), '-'.$dayOfWeek); var_dump(date('d', $startOfWeek->getTimestamp()));
based on s8unb
Output for 7.0.0 - 7.1.0
Warning: date_modify() expects parameter 1 to be DateTime, boolean given in /in/vJkSU on line 6 Fatal error: Uncaught Error: Call to a member function getTimestamp() on boolean in /in/vJkSU:7 Stack trace: #0 {main} thrown in /in/vJkSU on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Catchable fatal error: Argument 1 passed to date_modify() must be an instance of DateTime, bool given in /in/vJkSU on line 6
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Warning: date_modify() expects parameter 1 to be DateTime, boolean given in /in/vJkSU on line 6 Fatal error: Call to a member function getTimestamp() on boolean in /in/vJkSU on line 7
Process exited with code 255.
Output for 5.2.6 - 5.5.37
Warning: date_modify() expects parameter 1 to be DateTime, boolean given in /in/vJkSU on line 6 Fatal error: Call to a member function getTimestamp() on a non-object in /in/vJkSU on line 7
Process exited with code 255.
Output for 5.2.0 - 5.2.5
Warning: date_create(): Failed to parse time string (1408701067) at position 8 (6): Unexpected character in /in/vJkSU on line 6 Fatal error: Call to a member function getTimestamp() on a non-object in /in/vJkSU 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/vJkSU 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/vJkSU 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/vJkSU 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/vJkSU on line 6