3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentDate = date("Y-m-d"); $currentTime = date("H:i:s"); $row2['post_date'] = "2013-12-02 10:00:00"; $currentDateHour = date("H", strtotime($currentDate . " " . $currentTime)); // This is the date I'm pulling from the database, it only displays // when in strtotime for some reason. It displays accurately to what is in the mySQL DB $upDate = date("Y-m-d H", strtotime($row2['post_date'])); // Some variables to make life easier for later if statements if I ever get that far. Displays accurately. $upDatehour = date("H", strtotime($row2['post_date'])); // trying simple subtraction $hour = $currentDateHour - $upDatehour; // this is where the result is incorrect, what is wrong here? Any method I've tried gives me the same result, with or without strotime.. it's gotta be something simple, always is! print $hour;

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)
8.3.60.0170.00318.68
8.3.50.0110.00717.55
8.3.40.0150.00019.04
8.3.30.0150.00018.94
8.3.20.0080.00019.20
8.3.10.0080.00020.78
8.3.00.0050.00319.75
8.2.180.0110.01116.75
8.2.170.0140.00322.96
8.2.160.0150.00422.12
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0070.00019.97
8.2.110.0090.00022.02
8.2.100.0040.00818.16
8.2.90.0050.00318.09
8.2.80.0060.00317.97
8.2.70.0040.00817.25
8.2.60.0040.00418.15
8.2.50.0040.00418.07
8.2.40.0050.00320.20
8.2.30.0040.00418.12
8.2.20.0040.00417.99
8.2.10.0040.00418.07
8.2.00.0040.00418.02
8.1.270.0050.00323.99
8.1.260.0030.00526.35
8.1.250.0050.00228.09
8.1.240.0040.00422.20
8.1.230.0110.00020.94
8.1.220.0040.00417.79
8.1.210.0050.00319.04
8.1.200.0060.00317.38
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0030.00518.77
8.1.160.0000.00819.05
8.1.150.0030.00518.76
8.1.140.0000.00717.77
8.1.130.0000.00717.82
8.1.120.0040.00417.59
8.1.110.0040.00417.67
8.1.100.0040.00417.63
8.1.90.0050.00217.70
8.1.80.0050.00517.58
8.1.70.0030.00317.56
8.1.60.0050.00317.66
8.1.50.0050.00217.62
8.1.40.0040.00417.49
8.1.30.0060.00317.70
8.1.20.0040.00417.65
8.1.10.0000.00817.75
8.1.00.0000.00717.61
8.0.300.0040.00419.85
8.0.290.0040.00417.00
8.0.280.0000.00718.55
8.0.270.0030.00417.36
8.0.260.0030.00318.87
8.0.250.0050.00317.15
8.0.240.0060.00317.25
8.0.230.0000.00717.22
8.0.220.0000.00717.18
8.0.210.0030.00317.06
8.0.200.0040.00417.23
8.0.190.0000.00717.26
8.0.180.0000.00717.24
8.0.170.0030.00617.23
8.0.160.0030.00317.17
8.0.150.0040.00417.12
8.0.140.0070.00416.98
8.0.130.0000.00513.57
8.0.120.0000.00717.07
8.0.110.0070.00016.99
8.0.100.0030.00517.06
8.0.90.0080.00017.10
8.0.80.0060.01317.15
8.0.70.0050.00317.30
8.0.60.0000.00817.25
8.0.50.0040.00417.17
8.0.30.0060.01217.28
8.0.20.0040.01517.28
8.0.10.0030.00517.30
8.0.00.0090.00917.03
7.4.330.0020.00214.96
7.4.320.0030.00316.66
7.4.300.0030.00316.67
7.4.290.0000.00716.71
7.4.280.0080.00016.81
7.4.270.0070.00016.77
7.4.260.0030.00313.47
7.4.250.0040.00416.78
7.4.240.0030.00316.77
7.4.230.0030.00316.59
7.4.220.0120.00316.75
7.4.210.0080.01016.65
7.4.200.0000.00716.80
7.4.190.0030.00316.87
7.4.160.0080.00816.54
7.4.150.0040.01517.07
7.4.140.0110.00517.24
7.4.130.0090.00816.75
7.4.120.0090.00916.74
7.4.110.0190.00516.69
7.4.100.0100.01416.62
7.4.90.0220.00316.74
7.4.80.0070.01418.80
7.4.70.0100.01016.61
7.4.60.0100.00716.66
7.4.50.0030.00616.40
7.4.40.0000.01222.26
7.4.30.0030.01516.63
7.4.10.0100.00715.10
7.4.00.0050.01315.06
7.3.330.0030.00313.16
7.3.320.0030.00313.36
7.3.310.0030.00316.28
7.3.300.0070.00016.50
7.3.290.0070.01216.59
7.3.280.0100.00916.49
7.3.270.0090.00917.07
7.3.260.0140.00618.24
7.3.250.0030.02016.60
7.3.240.0090.00616.54
7.3.230.0100.01316.65
7.3.210.0060.01216.48
7.3.200.0140.00519.39
7.3.190.0060.01316.70
7.3.180.0120.00616.48
7.3.170.0130.00316.79
7.3.160.0090.00616.85
7.3.130.0090.00915.02
7.3.120.0050.01115.18
7.3.110.0090.00715.00
7.3.100.0030.01214.79
7.3.90.0020.01215.03
7.3.80.0050.00414.93
7.3.70.0030.00914.89
7.3.60.0080.00514.85
7.3.50.0030.00914.91
7.3.40.0060.00714.98
7.3.30.0030.00914.95
7.3.20.0070.00816.72
7.3.10.0090.00616.69
7.3.00.0090.00516.80
7.2.330.0110.01116.58
7.2.320.0070.01116.88
7.2.310.0130.01016.97
7.2.300.0070.01017.05
7.2.290.0000.02316.96
7.2.260.0140.00415.29
7.2.250.0070.01015.23
7.2.240.0090.00515.17
7.2.230.0070.00915.10
7.2.220.0060.00815.12
7.2.210.0060.00815.07
7.2.200.0010.01115.07
7.2.190.0040.00915.17
7.2.180.0100.00515.28
7.2.170.0060.00915.18
7.2.160.0070.00615.11
7.2.150.0070.00617.23
7.2.140.0030.01117.03
7.2.130.0060.00816.98
7.2.120.0070.00817.04
7.2.110.0050.01017.05
7.2.100.0040.01017.08
7.2.90.0040.01017.11
7.2.80.0040.01017.12
7.2.70.0080.00417.09
7.2.60.0090.00517.20
7.2.50.0040.00917.19
7.2.40.0040.00717.08
7.2.30.0030.00817.11
7.2.20.0050.00917.14
7.2.10.0060.00617.15
7.2.00.0060.00617.74
7.1.330.0060.00815.94
7.1.320.0040.00615.93
7.1.310.0070.00715.78
7.1.300.0060.00715.78
7.1.290.0060.00716.00
7.1.280.0090.00715.94
7.1.270.0060.00715.98
7.1.260.0090.00715.98
7.1.250.0060.00715.83
7.1.240.0060.00615.70
7.1.230.0030.01615.88
7.1.220.0090.00316.02
7.1.210.0070.00716.00
7.1.200.0060.01016.06
7.1.190.0070.00716.17
7.1.180.0000.00915.84
7.1.170.0000.01315.82
7.1.160.0070.00715.99
7.1.150.0000.01115.95
7.1.140.0070.00315.93
7.1.130.0080.00816.02
7.1.120.0050.00315.76
7.1.110.0100.00716.01
7.1.100.0050.00817.21
7.1.90.0150.00015.91
7.1.80.0030.01015.68
7.1.70.0020.00616.63
7.1.60.0020.01317.66
7.1.50.0030.01216.61
7.1.40.0040.00815.91
7.1.30.0000.01116.09
7.1.20.0000.01416.00
7.1.10.0090.00615.71
7.1.00.0070.03219.14
7.0.330.0000.01315.55
7.0.320.0030.00915.52
7.0.310.0060.00615.38
7.0.300.0000.01215.53
7.0.290.0000.00815.54
7.0.280.0030.01015.34
7.0.270.0040.00815.43
7.0.260.0050.00515.62
7.0.250.0080.00815.35
7.0.240.0120.00015.52
7.0.230.0090.00315.36
7.0.220.0090.00015.47
7.0.210.0100.00315.46
7.0.200.0030.00716.34
7.0.190.0030.01215.53
7.0.180.0030.01315.46
7.0.170.0060.00915.69
7.0.160.0040.00415.47
7.0.150.0070.01115.52
7.0.140.0090.04518.80
7.0.130.0090.00915.58
7.0.120.0050.02218.80
7.0.110.0090.00315.51
7.0.100.0080.00415.62
7.0.90.0060.04018.72
7.0.80.0030.04618.48
7.0.70.0080.04018.61
7.0.60.0080.03318.71
7.0.50.0080.02418.84
7.0.40.0080.04216.82
7.0.30.0020.04916.92
7.0.20.0050.04516.84
7.0.10.0020.03216.89
7.0.00.0090.04016.80
5.6.400.0070.00314.62
5.6.390.0000.00814.51
5.6.380.0060.01014.44
5.6.370.0090.00914.77
5.6.360.0090.00614.43
5.6.350.0030.01014.86
5.6.340.0000.00914.84
5.6.330.0120.00014.77
5.6.320.0120.00314.21
5.6.310.0070.00714.68
5.6.300.0040.01114.69
5.6.290.0160.00314.33
5.6.280.0090.03817.84
5.6.270.0070.00714.63
5.6.260.0040.01114.82
5.6.250.0090.00614.68
5.6.240.0080.02717.53
5.6.230.0070.03117.57
5.6.220.0020.03017.63
5.6.210.0070.04017.56
5.6.200.0050.03317.63
5.6.190.0080.04117.88
5.6.180.0030.04517.76
5.6.170.0050.03517.68
5.6.160.0060.03817.88
5.6.150.0080.04317.69
5.6.140.0040.03917.78
5.6.130.0050.04417.80
5.6.120.0030.04817.88
5.6.110.0060.02617.68
5.6.100.0050.02617.68
5.6.90.0020.04817.85
5.6.80.0050.02817.45
5.6.70.0020.04517.54
5.6.60.0090.03317.44
5.6.50.0000.04517.53
5.6.40.0090.03717.50
5.6.30.0050.04317.35
5.6.20.0040.04217.48
5.6.10.0070.04017.27
5.6.00.0050.02517.51
5.5.380.0100.03917.55
5.5.370.0060.04117.46
5.5.360.0090.03917.42
5.5.350.0100.02517.50
5.5.340.0020.03417.70
5.5.330.0060.03117.61
5.5.320.0070.03617.71
5.5.310.0050.04317.60
5.5.300.0000.04817.72
5.5.290.0050.03017.80
5.5.280.0030.04517.75
5.5.270.0050.03617.60
5.5.260.0080.04517.52
5.5.250.0050.04117.47
5.5.240.0030.04717.33
5.5.230.0090.03317.41
5.5.220.0060.02717.41
5.5.210.0030.04417.26
5.5.200.0070.02217.26
5.5.190.0020.04317.40
5.5.180.0050.04017.34
5.5.170.0000.01314.56
5.5.160.0070.03917.26
5.5.150.0040.01817.33
5.5.140.0030.02317.26
5.5.130.0020.04817.10
5.5.120.0100.04017.29
5.5.110.0100.02317.26
5.5.100.0060.03717.21
5.5.90.0040.02817.26
5.5.80.0040.02817.28
5.5.70.0040.04617.29
5.5.60.0000.04717.21
5.5.50.0070.02917.22
5.5.40.0060.02517.16
5.5.30.0080.03917.27
5.5.20.0050.04117.32
5.5.10.0050.03317.23
5.5.00.0030.03717.14
5.4.450.0030.03015.87
5.4.440.0020.02715.84
5.4.430.0070.03615.89
5.4.420.0030.04015.86
5.4.410.0050.02615.75
5.4.400.0030.03315.71
5.4.390.0070.04215.75
5.4.380.0000.04415.76
5.4.370.0060.03615.59
5.4.360.0020.04715.80
5.4.350.0050.01915.70
5.4.340.0030.03615.73
5.4.330.0090.00312.38
5.4.320.0110.03615.69
5.4.310.0030.03815.74
5.4.300.0030.04215.73
5.4.290.0080.03315.58
5.4.280.0030.02815.68
5.4.270.0080.03415.70
5.4.260.0030.04415.80
5.4.250.0050.04215.75
5.4.240.0040.04015.70
5.4.230.0020.02715.80
5.4.220.0050.02315.73
5.4.210.0030.04015.70
5.4.200.0030.04015.64
5.4.190.0100.03515.73
5.4.180.0060.03715.70
5.4.170.0020.04015.73
5.4.160.0030.04015.73
5.4.150.0020.04315.79
5.4.140.0050.03714.33
5.4.130.0030.02314.35
5.4.120.0040.03914.35
5.4.110.0040.02514.39
5.4.100.0020.02314.33
5.4.90.0050.04014.34
5.4.80.0030.04014.40
5.4.70.0080.03314.35
5.4.60.0090.03514.35
5.4.50.0030.02514.38
5.4.40.0030.03014.42
5.4.30.0050.03814.33
5.4.20.0050.03714.38
5.4.10.0000.04314.38
5.4.00.0050.03414.06
5.3.290.0050.02013.49
5.3.280.0050.02113.48
5.3.270.0030.03713.48
5.3.260.0050.02913.49
5.3.250.0000.03713.46
5.3.240.0010.03513.48
5.3.230.0030.02313.49
5.3.220.0050.02213.46
5.3.210.0060.03613.45
5.3.200.0000.02613.48
5.3.190.0040.02213.46
5.3.180.0080.03713.47
5.3.170.0030.03313.40
5.3.160.0050.03713.45
5.3.150.0030.02013.39
5.3.140.0050.03513.46
5.3.130.0070.03713.45
5.3.120.0020.03213.42
5.3.110.0000.04313.39
5.3.100.0010.03113.20
5.3.90.0020.03713.16
5.3.80.0030.03013.19
5.3.70.0060.02713.08
5.3.60.0000.04313.17
5.3.50.0030.04213.13
5.3.40.0090.03513.15
5.3.30.0060.03713.14
5.3.20.0010.04113.04
5.3.10.0020.03913.00
5.3.00.0020.03813.00
5.2.170.0000.05011.13
5.2.160.0000.05311.19
5.2.150.0000.04311.16
5.2.140.0000.04711.06
5.2.130.0000.04711.14
5.2.120.0030.03311.13
5.2.110.0070.02311.14
5.2.100.0030.05710.96
5.2.90.0000.06011.10
5.2.80.0030.05011.07
5.2.70.0030.02711.09
5.2.60.0000.05011.05
5.2.50.0000.06311.08
5.2.40.0070.05710.84
5.2.30.0070.06011.04
5.2.20.0030.03010.79
5.2.10.0000.06710.92
5.2.00.0000.04010.66
5.1.60.0000.04310.08
5.1.50.0000.0509.98
5.1.40.0030.0509.97
5.1.30.0000.04710.32
5.1.20.0030.03710.33
5.1.10.0000.03010.14
5.1.00.0000.0309.90
5.0.50.0000.0378.77
5.0.40.0000.0478.77
5.0.30.0070.0608.77
5.0.20.0100.0178.77
5.0.10.0030.0338.77
5.0.00.0000.0438.77
4.4.90.0000.0338.77
4.4.80.0000.0238.77
4.4.70.0070.0278.77
4.4.60.0000.0278.77
4.4.50.0000.0208.77
4.4.40.0000.0378.77
4.4.30.0030.0308.77
4.4.20.0000.0378.77
4.4.10.0000.0338.77
4.4.00.0000.0438.77
4.3.110.0000.0308.77
4.3.100.0030.0308.77
4.3.90.0000.0338.77
4.3.80.0030.0278.77
4.3.70.0030.0338.77
4.3.60.0030.0308.77
4.3.50.0000.0338.77
4.3.40.0030.0508.77
4.3.30.0000.0378.77
4.3.20.0000.0308.77
4.3.10.0000.0338.77
4.3.00.0000.0378.77

preferences:
79.68 ms | 400 KiB | 5 Q