3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //Check dates //$curDateTime = time(); $oldDateTime = $customerLock[0]['change_date']; $oldDateTime = 1443530876;//This is the output from the above one, just for this Example. $date1 = new DateTime(); $date1->createFromFormat('H:i:s d/m/Y', Date('H:i:s d/m/Y', $curDateTime)); $date2 = new DateTime(); $date2->createFromFormat('H:i:s d/m/Y', Date('H:i:s d/m/Y', $oldDateTime)); $unix_to_date = Date('H:i:s d/m/Y', $oldDateTime); //to check the valid timestamp //die(var_dump($unix_to_date)); //outputs: string(19) "14:47:56 29/09/2015" //die(var_dump($date1)); //outputs: object(DateTime)#3 (3) { ["date"]=> string(26) "2015-09-30 12:31:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } //valid object as it's the currentDate earlier set. die(var_dump($date2)); //outputs: object(DateTime)#4 (3) { ["date"]=> string(26) "2015-09-30 12:32:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } //Which is wrong as it's the current date time. ?> }
Output for 7.2.0
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-30 12:34:49.002898" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.10
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-30 12:34:49.002853" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.7
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-30 12:34:49.003331" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.6
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-30 12:34:49.012525" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.5
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-30 12:34:49.005376" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-30 12:34:49.004083" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.30 - 5.4.45, 5.5.14 - 7.0.20
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-30 12:34:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.0 - 5.4.29, 5.5.0 - 5.5.13
Notice: Undefined variable: customerLock in /in/8DN9C on line 5 Notice: Undefined variable: curDateTime in /in/8DN9C on line 9 object(DateTime)#2 (3) { ["date"]=> string(19) "2015-09-30 12:34:49" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }