3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // get the old DateTime object created from the month and year $oldDate = date_create_from_format("n Y", "9 2013"); // get the current DateTime object $currentDate = new DateTime(); // calculate the interval between the two $dateInterval = $currentDate->diff($oldDate,true); echo $dateInterval->m;
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2
Output for 5.0.0 - 5.2.17
Fatal error: Call to undefined function date_create_from_format() in /in/JAbQ9 on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_create_from_format() in /in/JAbQ9 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_create_from_format() in /in/JAbQ9 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_create_from_format() in /in/JAbQ9 on line 3