3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $startDate = date('m/d/y', date_sub(date_create(),date_interval_create_from_date_string("7 days"))); $endDate = date('m/d/y'); echo $startDate; echo $endDate; ?>
based on cRMdS
Output for 7.0.0 - 7.2.0
Warning: date() expects parameter 2 to be integer, object given in /in/Ps3gA on line 2 08/31/15
Output for 5.3.0 - 5.6.28
Warning: date() expects parameter 2 to be long, object given in /in/Ps3gA on line 2 08/31/15
Output for 5.0.0 - 5.2.17
Fatal error: Call to undefined function date_sub() in /in/Ps3gA on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_sub() in /in/Ps3gA on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_sub() in /in/Ps3gA on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_sub() in /in/Ps3gA on line 2