3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //list($BonusLoginCount, $BonusLastLoginDay) = $DB->next_record(); $BonusLoginCount=0; $BonusLastLoginDay="2015-03-10"; //echo $BonusLoginCount; //echo "\r\n"; //echo $BonusLastLoginDay; $datetime1 = date_create($BonusLastLoginDay); $datetime2 = date_create(date("Y-m-d")); $interval = date_diff($datetime1, $datetime2); echo "differenz: ".$interval->format('%a days') //if ((date('His dmY')-date('His dmY', $BonusLastLoginDay))==1) { // gestern fand ein login statt //} ?>
based on UFQk2
Output for 5.3.0 - 7.3.0rc3
differenz: 3 days
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined function date_diff() in /in/IB7B8 on line 12
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function date_create() in /in/IB7B8 on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_create() in /in/IB7B8 on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_create() in /in/IB7B8 on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_create() in /in/IB7B8 on line 10