3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sdate = DateTime::createFromFormat('d/m/Y', '04/05/2014'); var_dump($sdate); $date = new DateTime($sdate::date); $date->add(new DateInterval('P1D')); echo $date->format('Y-m-d');
Output for 7.0.0 - 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:20:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught Error: Undefined class constant 'date' in /in/NbPjv:5 Stack trace: #0 {main} thrown in /in/NbPjv on line 5
Process exited with code 255.
Output for hhvm-3.12.0 - 3.13.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:20:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Uncaught Error: Couldn't find constant DateTime::date in /in/NbPjv:5 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:20:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Couldn't find constant DateTime::date in /in/NbPjv on line 5
Process exited with code 255.
Output for 5.4.30 - 5.4.45, 5.5.14 - 5.6.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2014-05-04 06:20:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Undefined class constant 'date' in /in/NbPjv on line 5
Process exited with code 255.
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
object(DateTime)#1 (3) { ["date"]=> string(19) "2014-05-04 06:20:09" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Fatal error: Undefined class constant 'date' in /in/NbPjv on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/NbPjv on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /in/NbPjv on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/NbPjv on line 5
Process exited with code 255.