3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime1 = date_create('now'); $datetime2 = date_create('13-11-2013'); $interval = date_diff($datetime1, $datetime2); echo $interval->format('%R%a dias'); echo "\n".'24-05-2013 (-143 dias)';
Output for 5.6.28, 7.0.14 - 7.1.0
+28 dias 24-05-2013 (-143 dias)
Output for 7.0.6
-920 dias 24-05-2013 (-143 dias)
Output for 7.0.5
-872 dias 24-05-2013 (-143 dias)
Output for 7.0.4
-848 dias 24-05-2013 (-143 dias)
Output for 7.0.3
-856 dias 24-05-2013 (-143 dias)
Output for 7.0.2
-861 dias 24-05-2013 (-143 dias)
Output for 7.0.1
-862 dias 24-05-2013 (-143 dias)
Output for 7.0.0
-865 dias 24-05-2013 (-143 dias)
Output for 5.6.21
-901 dias 24-05-2013 (-143 dias)
Output for 5.6.20
-879 dias 24-05-2013 (-143 dias)
Output for 5.6.19
-846 dias 24-05-2013 (-143 dias)
Output for 5.6.18
-853 dias 24-05-2013 (-143 dias)
Output for 5.6.17
-858 dias 24-05-2013 (-143 dias)
Output for 5.6.16
-866 dias 24-05-2013 (-143 dias)
Output for 5.6.15
-867 dias 24-05-2013 (-143 dias)
Output for 5.6.14
-883 dias 24-05-2013 (-143 dias)
Output for 5.6.13
-884 dias 24-05-2013 (-143 dias)
Output for 5.6.12
-889 dias 24-05-2013 (-143 dias)
Output for 5.6.11
-893 dias 24-05-2013 (-143 dias)
Output for 5.6.10
-894 dias 24-05-2013 (-143 dias)
Output for 5.6.9
-896 dias 24-05-2013 (-143 dias)
Output for 5.6.8
-899 dias 24-05-2013 (-143 dias)
Output for 5.5.35
-922 dias 24-05-2013 (-143 dias)
Output for 5.5.34
-880 dias 24-05-2013 (-143 dias)
Output for 5.5.33
-847 dias 24-05-2013 (-143 dias)
Output for 5.5.32
-855 dias 24-05-2013 (-143 dias)
Output for 5.5.31
-859 dias 24-05-2013 (-143 dias)
Output for 5.5.30
-870 dias 24-05-2013 (-143 dias)
Output for 5.5.29
-886 dias 24-05-2013 (-143 dias)
Output for 5.5.28
-890 dias 24-05-2013 (-143 dias)
Output for 5.5.27
-891 dias 24-05-2013 (-143 dias)
Output for 5.5.26
-895 dias 24-05-2013 (-143 dias)
Output for 5.5.25
-898 dias 24-05-2013 (-143 dias)
Output for 5.5.24
-923 dias 24-05-2013 (-143 dias)
Output for 5.3.0 - 5.4.45
-774 dias 24-05-2013 (-143 dias)
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined function date_diff() in /in/o8YM5 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function date_create() in /in/o8YM5 on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_create() in /in/o8YM5 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_create() in /in/o8YM5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_create() in /in/o8YM5 on line 3