3v4l.org

run code in 300+ PHP versions simultaneously
<?php //Check dates $curDateTime = time(); //$oldDateTime = $customerLock[0]['change_date']; <== obtained from the DB $oldDateTime = 1443530876;//This is the output from the above one, just for this Example. $dateObj = new DateTime(); $date1 = $dateObj->createFromFormat('H:i:s d/m/Y', Date('H:i:s d/m/Y', $curDateTime)); $date2 = $dateObj->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 var_dump($unix_to_date); //outputs: string(19) "14:47:56 29/09/2015" 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. 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. ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0090.00316.35
7.3.00.0100.00716.39
7.2.130.0090.00616.72
7.2.120.0140.00416.54
7.2.110.0080.00816.59
7.2.100.0090.00616.90
7.2.90.0090.01316.73
7.2.80.0030.00916.48
7.2.70.0040.01516.86
7.2.60.0070.00816.72
7.2.50.0110.00416.43
7.2.40.0060.00616.42
7.2.30.0030.01016.61
7.2.20.0090.00316.82
7.2.10.0070.00716.74
7.2.00.0120.00518.30
7.1.250.0030.00815.36
7.1.200.0100.00315.94
7.1.100.0120.00418.34
7.1.70.0080.00017.22
7.1.60.0150.01119.12
7.1.50.0090.01616.93
7.1.00.0000.08022.46
7.0.200.0160.00316.89
7.0.100.0030.06319.89
7.0.90.0100.08319.85
7.0.80.0130.07019.91
7.0.70.0030.08319.91
7.0.60.0070.03319.85
7.0.50.0130.07320.28
7.0.40.0000.08720.18
7.0.30.0130.07720.09
7.0.20.0130.08020.18
7.0.10.0100.05720.09
7.0.00.0070.08720.08
5.6.280.0100.06020.88
5.6.250.0030.08320.60
5.6.240.0130.05320.68
5.6.230.0170.07020.66
5.6.220.0030.04020.67
5.6.210.0100.07320.45
5.6.200.0000.04721.04
5.6.190.0100.07321.04
5.6.180.0030.08021.03
5.6.170.0070.05321.03
5.6.160.0000.06721.11
5.6.150.0030.07021.01
5.6.140.0100.06720.99
5.6.130.0130.07321.11
5.6.120.0070.07320.94
5.6.110.0030.04721.01
5.6.100.0030.08320.99
5.6.90.0030.08321.00
5.6.80.0070.04320.37
5.6.70.0100.08020.42
5.6.60.0100.04320.38
5.6.50.0070.04320.43
5.6.40.0100.08320.40
5.6.30.0030.08320.38
5.6.20.0100.09320.46
5.6.10.0000.08720.47
5.6.00.0100.07720.34
5.5.380.0100.08320.35
5.5.370.0100.07720.35
5.5.360.0000.09020.33
5.5.350.0130.03720.43
5.5.340.0100.06720.63
5.5.330.0030.07320.86
5.5.320.0070.08720.83
5.5.310.0070.08020.89
5.5.300.0070.05720.87
5.5.290.0130.07720.75
5.5.280.0130.07320.92
5.5.270.0100.07720.90
5.5.260.0100.07320.86
5.5.250.0100.08020.45
5.5.240.0000.09020.16
5.5.230.0130.07720.23
5.5.220.0030.07320.29
5.5.210.0070.04720.20
5.5.200.0170.07020.13
5.5.190.0000.06020.11
5.5.180.0230.03320.07
5.5.160.0070.05720.21
5.5.150.0070.08320.16
5.5.140.0130.07320.13
5.5.130.0000.06720.21
5.5.120.0200.06720.21
5.5.110.0000.05720.18
5.5.100.0030.04720.15
5.5.90.0200.06719.96
5.5.80.0030.06720.12
5.5.70.0070.05720.13
5.5.60.0070.05320.08
5.5.50.0100.07320.05
5.5.40.0030.04020.15
5.5.30.0070.06720.14
5.5.20.0100.07020.07
5.5.10.0100.06720.00
5.5.00.0030.06319.95
5.4.450.0030.08319.11
5.4.440.0070.07319.45
5.4.430.0070.07719.35
5.4.420.0070.07019.11
5.4.410.0030.06719.16
5.4.400.0100.07719.10
5.4.390.0070.07719.07
5.4.380.0100.04019.10
5.4.370.0100.04019.13
5.4.360.0130.06319.07
5.4.350.0100.05019.10
5.4.340.0030.07318.98
5.4.320.0170.07018.94
5.4.310.0070.06719.05
5.4.300.0070.06718.90
5.4.290.0070.03718.96
5.4.280.0000.07718.78
5.4.270.0100.06018.96
5.4.260.0130.07018.78
5.4.250.0030.08019.05
5.4.240.0100.05719.13
5.4.230.0130.04318.97
5.4.220.0100.07318.97
5.4.210.0070.05319.22
5.4.200.0070.06718.89
5.4.190.0070.07319.02
5.4.180.0130.07018.89
5.4.170.0070.07719.11
5.4.160.0070.06019.09
5.4.150.0070.07319.04
5.4.140.0000.07716.34
5.4.130.0130.06316.41
5.4.120.0130.04716.43
5.4.110.0070.07316.50
5.4.100.0100.07016.27
5.4.90.0030.07316.50
5.4.80.0100.03716.30
5.4.70.0030.06316.27
5.4.60.0100.06016.41
5.4.50.0030.04316.20
5.4.40.0130.06016.33
5.4.30.0100.07316.39
5.4.20.0100.07016.30
5.4.10.0000.08316.18
5.4.00.0100.05715.78

preferences:
29.84 ms | 403 KiB | 5 Q