3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime('21-07-1988'); var_dump(get_class_methods($dt));
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
array(18) { [0]=> string(11) "__construct" [1]=> string(8) "__wakeup" [2]=> string(11) "__set_state" [3]=> string(16) "createFromFormat" [4]=> string(13) "getLastErrors" [5]=> string(6) "format" [6]=> string(6) "modify" [7]=> string(3) "add" [8]=> string(3) "sub" [9]=> string(11) "getTimezone" [10]=> string(11) "setTimezone" [11]=> string(9) "getOffset" [12]=> string(7) "setTime" [13]=> string(7) "setDate" [14]=> string(10) "setISODate" [15]=> string(12) "setTimestamp" [16]=> string(12) "getTimestamp" [17]=> string(4) "diff" }
Output for hhvm-3.10.0 - 3.12.0
array(19) { [0]=> string(3) "add" [1]=> string(11) "__construct" [2]=> string(16) "createFromFormat" [3]=> string(4) "diff" [4]=> string(6) "format" [5]=> string(13) "getLastErrors" [6]=> string(9) "getOffset" [7]=> string(12) "getTimestamp" [8]=> string(11) "getTimezone" [9]=> string(6) "modify" [10]=> string(7) "setDate" [11]=> string(10) "setISODate" [12]=> string(7) "setTime" [13]=> string(12) "setTimestamp" [14]=> string(11) "setTimezone" [15]=> string(3) "sub" [16]=> string(7) "__sleep" [17]=> string(8) "__wakeup" [18]=> string(11) "__debugInfo" }
Output for 5.2.0 - 5.2.17
array(9) { [0]=> string(11) "__construct" [1]=> string(6) "format" [2]=> string(6) "modify" [3]=> string(11) "getTimezone" [4]=> string(11) "setTimezone" [5]=> string(9) "getOffset" [6]=> string(7) "setTime" [7]=> string(7) "setDate" [8]=> string(10) "setISODate" }
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/VCGKv on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/VCGKv on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/VCGKv on line 3