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. $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 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.4.00.0040.00815.22
7.3.120.0070.01014.55
7.3.110.0120.00614.94
7.3.100.0030.00615.01
7.3.90.0060.01214.86
7.3.80.0030.01315.00
7.3.70.0030.00915.06
7.3.60.0000.01614.96
7.3.50.0000.00914.92
7.3.40.0070.00714.90
7.3.30.0040.01114.89
7.3.20.0040.01116.63
7.3.10.0040.01116.71
7.3.00.0030.01216.61
7.2.250.0090.00915.33
7.2.240.0030.01715.24
7.2.230.0030.01215.22
7.2.220.0090.00914.74
7.2.210.0090.00614.95
7.2.200.0060.00315.32
7.2.190.0000.01315.13
7.2.180.0090.00015.09
7.2.170.0070.01015.28
7.2.110.0120.00316.75
7.2.100.0030.00916.66
7.2.90.0160.00016.52
7.2.80.0040.01016.53
7.2.70.0070.00716.89
7.2.60.0050.00916.68
7.2.50.0040.01116.64
7.2.40.0070.00716.52
7.2.30.0080.00616.90
7.2.20.0000.01217.13
7.2.10.0090.00617.02
7.2.00.0040.01417.00
7.1.330.0020.01415.98
7.1.320.0060.00616.06
7.1.310.0090.00616.02
7.1.300.0040.01115.77
7.1.290.0030.01415.98
7.1.280.0040.01216.03
7.1.270.0060.00815.90
7.1.260.0000.01715.90
7.1.230.0070.00715.73
7.1.220.0040.01115.94
7.1.210.0030.01315.63
7.1.200.0040.00415.87
7.1.190.0090.00315.83
7.1.180.0030.01315.69
7.1.170.0090.00615.68
7.1.160.0040.00815.60
7.1.150.0030.01015.88
7.1.140.0060.00915.81
7.1.130.0060.00615.81
7.1.120.0070.00715.98
7.1.110.0100.00315.83
7.1.100.0060.00617.15
7.1.90.0080.00315.74
7.1.80.0090.00315.84
7.1.70.0080.00316.47
7.1.60.0070.01217.56
7.1.50.0070.00716.32
7.1.40.0160.00315.98
7.1.30.0030.01416.13
7.1.20.0070.01116.09
7.1.10.0030.00615.72
7.1.00.0070.04219.04
7.0.310.0060.00915.66
7.0.300.0030.01015.66
7.0.290.0060.00615.59
7.0.280.0040.01215.71
7.0.270.0100.00715.69
7.0.260.0030.00915.56
7.0.250.0040.00415.57
7.0.240.0000.01115.74
7.0.230.0100.00315.69
7.0.220.0070.00715.42
7.0.210.0060.00615.45
7.0.200.0060.00716.21
7.0.190.0120.00315.30
7.0.180.0120.00315.51
7.0.170.0060.00915.72
7.0.160.0070.00715.50
7.0.150.0070.00715.59
7.0.140.0040.00415.48
7.0.130.0000.00715.58
7.0.120.0070.00715.46
7.0.110.0050.00415.39
7.0.100.0030.01015.12
7.0.90.0070.02317.75
7.0.80.0100.01717.84
7.0.70.0050.02317.75
7.0.60.0040.02517.62
7.0.50.0030.02717.88
7.0.40.0110.02216.73
7.0.30.0050.03716.73
7.0.20.0080.02716.81
7.0.10.0070.02016.90
7.0.00.0030.02316.86
5.6.380.0000.01614.66
5.6.370.0060.00614.43
5.6.360.0030.01014.42
5.6.350.0070.00714.39
5.6.340.0070.00714.86
5.6.330.0060.00814.39
5.6.320.0030.00914.47
5.6.310.0070.00714.44
5.6.300.0030.01014.57
5.6.290.0090.00614.43
5.6.280.0020.03717.61
5.6.270.0080.00414.45
5.6.260.0120.00314.31
5.6.250.0160.00014.49
5.6.240.0070.02017.61
5.6.230.0030.02317.46
5.6.220.0060.02117.53
5.6.210.0070.02017.46
5.6.200.0020.02517.69
5.6.190.0070.02517.81
5.6.180.0050.03317.67
5.6.170.0060.02517.63
5.6.160.0020.02617.91
5.6.150.0070.02517.72
5.6.140.0030.02617.83
5.6.130.0070.01917.67
5.6.120.0060.02517.84
5.6.110.0080.04117.87
5.6.100.0030.02417.67
5.6.90.0070.02217.71
5.6.80.0070.02317.57
5.6.70.0050.03017.35
5.6.60.0050.04317.35
5.6.50.0030.04417.32
5.6.40.0030.04717.21
5.6.30.0040.04317.34
5.6.20.0050.04417.31
5.6.10.0050.04217.45
5.6.00.0070.04017.38
5.5.380.0020.03716.60
5.5.370.0080.02016.62
5.5.360.0020.03616.68
5.5.350.0030.02416.56
5.5.340.0040.02416.82
5.5.330.0060.02116.79
5.5.320.0070.02016.79
5.5.310.0040.02216.79
5.5.300.0000.02416.86
5.5.290.0000.02816.79
5.5.280.0040.02016.84
5.5.270.0040.02016.85
5.5.260.0030.02516.77
5.5.250.0030.04516.74
5.5.240.0040.02416.47
5.5.230.0030.02116.51
5.5.220.0050.03916.49
5.5.210.0070.04516.53
5.5.200.0070.03716.44
5.5.190.0010.03016.50
5.5.180.0060.03816.53
5.5.170.0070.00414.13
5.5.160.0070.03316.44
5.5.150.0070.03716.52
5.5.140.0030.04216.52
5.5.130.0100.02916.51
5.5.120.0110.03716.47
5.5.110.0040.04516.46
5.5.100.0130.03616.43
5.5.90.0050.04316.46
5.5.80.0120.02316.45
5.5.70.0030.04216.45
5.5.60.0070.03916.43
5.5.50.0050.02716.47
5.5.40.0050.02316.43
5.5.30.0090.02116.46
5.5.20.0080.04016.46
5.5.10.0080.04016.37
5.5.00.0020.04216.41
5.4.450.0020.02715.97
5.4.440.0030.02716.12
5.4.430.0070.02016.08
5.4.420.0020.02216.13
5.4.410.0030.02316.00
5.4.400.0040.03015.91
5.4.390.0020.03015.87
5.4.380.0050.03815.94
5.4.370.0030.02515.88
5.4.360.0090.02215.94
5.4.350.0100.03615.87
5.4.340.0030.04315.92
5.4.330.0030.00712.79
5.4.320.0090.03515.91
5.4.310.0080.03315.96
5.4.300.0030.03915.86
5.4.290.0030.03615.86
5.4.280.0080.03915.84
5.4.270.0030.03415.94
5.4.260.0050.04015.96
5.4.250.0080.03715.94
5.4.240.0030.03815.86
5.4.230.0050.04515.85
5.4.220.0040.02415.92
5.4.210.0020.03915.90
5.4.200.0070.03815.92
5.4.190.0050.02315.84
5.4.180.0060.04015.95
5.4.170.0030.04315.96
5.4.160.0070.02915.78
5.4.150.0070.04115.91
5.4.140.0030.03714.48
5.4.130.0050.03814.59
5.4.120.0050.03714.58
5.4.110.0060.03514.63
5.4.100.0050.03314.63
5.4.90.0030.03814.64
5.4.80.0030.04214.64
5.4.70.0000.02514.58
5.4.60.0060.03314.55
5.4.50.0030.04114.58
5.4.40.0070.02914.58
5.4.30.0080.03814.54
5.4.20.0020.03714.56
5.4.10.0030.03014.53
5.4.00.0070.03714.29

preferences:
30.62 ms | 401 KiB | 5 Q