3v4l.org

run code in 300+ PHP versions simultaneously
<?php // vychozi pripocet je cela ctvrthodina $diff = 15; $dt = new DateTime; $minutes = $dt->format('i'); $minutes = (strlen($minutes) == 2) ? (int) $minutes[1] : (int) $minutes; // najdi nejblizsi celou ctvrthodinu $quarters = array(15, 30, 45, 60); foreach($quarters as $quarter){ $curDiff = $quarter - $minutes; echo $curDiff."\n"; // pokud je interval mensi nez minuly a zaroven kladny // presne 0 je na dane ctvrthodine a to chceme pripocist plnych 15 min if($curDiff < $diff && $curDiff > 0){ $diff = $curDiff; } } $dt->add(new DateInterval('PT'.$diff.'M')); echo $dt->format('Y-m-d H:i:00').PHP_EOL; echo date('H:i');

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.0090.01218.43
8.3.50.0120.00621.99
8.3.40.0040.01119.09
8.3.30.0120.00918.84
8.3.20.0050.00318.82
8.3.10.0080.00020.78
8.3.00.0090.00023.61
8.2.180.0100.01016.47
8.2.170.0090.00622.96
8.2.160.0090.01220.38
8.2.150.0100.01024.18
8.2.140.0080.00024.66
8.2.130.0030.00626.16
8.2.120.0040.00419.61
8.2.110.0060.00322.31
8.2.100.0080.00317.97
8.2.90.0000.00719.25
8.2.80.0050.00318.05
8.2.70.0060.00317.75
8.2.60.0030.00518.13
8.2.50.0000.00818.07
8.2.40.0080.00318.34
8.2.30.0040.00420.04
8.2.20.0070.00017.88
8.2.10.0020.00517.89
8.2.00.0040.00417.99
8.1.280.0090.00625.92
8.1.270.0050.00223.99
8.1.260.0100.01026.35
8.1.250.0050.00328.09
8.1.240.0060.00322.72
8.1.230.0040.00820.98
8.1.220.0050.00318.77
8.1.210.0030.00518.91
8.1.200.0050.00517.47
8.1.190.0040.00417.52
8.1.180.0040.00418.10
8.1.170.0040.00418.66
8.1.160.0050.00218.95
8.1.150.0040.00418.82
8.1.140.0000.00717.73
8.1.130.0030.00317.84
8.1.120.0000.00817.58
8.1.110.0000.00817.66
8.1.100.0000.00717.64
8.1.90.0040.00417.57
8.1.80.0000.00717.66
8.1.70.0030.00317.65
8.1.60.0030.00617.69
8.1.50.0040.00417.50
8.1.40.0030.00617.61
8.1.30.0040.00417.61
8.1.20.0090.00017.62
8.1.10.0030.00517.61
8.1.00.0080.00017.71
8.0.300.0070.00020.02
8.0.290.0000.00717.18
8.0.280.0070.00018.52
8.0.270.0050.00217.27
8.0.260.0000.00617.07
8.0.250.0070.00317.18
8.0.240.0100.00017.16
8.0.230.0030.00317.14
8.0.220.0000.00716.96
8.0.210.0000.00716.98
8.0.200.0070.00017.04
8.0.190.0030.00517.13
8.0.180.0040.00417.00
8.0.170.0040.00417.13
8.0.160.0040.00417.16
8.0.150.0030.00517.16
8.0.140.0040.00417.04
8.0.130.0050.00313.54
8.0.120.0050.00317.02
8.0.110.0040.00417.12
8.0.100.0040.00417.12
8.0.90.0040.00416.98
8.0.80.0090.01217.10
8.0.70.0030.00516.95
8.0.60.0080.00017.14
8.0.50.0040.00416.96
8.0.30.0120.00717.19
8.0.20.0110.00717.40
8.0.10.0050.00317.22
8.0.00.0100.01016.97
7.4.330.0000.00515.01
7.4.320.0000.00716.79
7.4.300.0000.00716.73
7.4.290.0070.00016.63
7.4.280.0000.00716.64
7.4.270.0000.00716.66
7.4.260.0030.00313.33
7.4.250.0060.00316.63
7.4.240.0040.00416.57
7.4.230.0070.00016.48
7.4.220.0000.01816.61
7.4.210.0100.00716.75
7.4.200.0050.00316.39
7.4.190.0000.00716.90
7.4.160.0090.00916.63
7.4.150.0150.00317.40
7.4.140.0060.01217.86
7.4.130.0100.00716.66
7.4.120.0070.01416.70
7.4.110.0120.00616.79
7.4.100.0070.01616.83
7.4.90.0100.00716.71
7.4.80.0080.01119.37
7.4.70.0070.01016.64
7.4.60.0060.00916.55
7.4.50.0000.00816.71
7.4.40.0040.01122.27
7.4.30.0120.00816.60
7.4.00.0100.00715.19
7.3.330.0050.00013.39
7.3.320.0050.00013.33
7.3.310.0000.00716.52
7.3.300.0070.00016.48
7.3.290.0070.00716.44
7.3.280.0090.00916.45
7.3.270.0070.01017.40
7.3.260.0070.01018.24
7.3.250.0120.01316.63
7.3.240.0120.00616.54
7.3.230.0090.00616.92
7.3.210.0030.01316.37
7.3.200.0070.01519.39
7.3.190.0130.00316.78
7.3.180.0100.00616.60
7.3.170.0150.00616.54
7.3.160.0100.01016.92
7.3.120.0060.01215.25
7.3.00.0070.00716.86
7.2.330.0110.00716.63
7.2.320.0100.00616.72
7.2.310.0090.00917.04
7.2.300.0100.00616.99
7.2.290.0110.00617.02
7.2.130.0100.00316.93
7.2.120.0030.00617.11
7.2.110.0060.00817.21
7.2.100.0030.01017.07
7.2.90.0030.01017.17
7.2.80.0040.00817.00
7.2.70.0060.01016.88
7.2.60.0040.00817.08
7.2.50.0030.01417.12
7.2.40.0070.01317.14
7.2.30.0100.01016.87
7.2.20.0000.01216.79
7.2.10.0000.01217.16
7.2.00.0020.01318.26
7.1.250.0040.01116.03
7.1.240.0060.00616.03
7.1.230.0040.00716.07
7.1.220.0030.01015.96
7.1.210.0060.00616.04
7.1.200.0090.00215.97
7.1.190.0030.01016.01
7.1.180.0090.00916.07
7.1.170.0140.00316.02
7.1.160.0050.00515.78
7.1.150.0120.00615.62
7.1.140.0030.00615.91
7.1.130.0030.00716.08
7.1.120.0060.00915.93
7.1.110.0030.00616.18
7.1.100.0020.01117.05
7.1.90.0090.00015.77
7.1.80.0030.00616.04
7.1.70.0020.00816.68
7.1.60.0060.00817.77
7.1.50.0020.01516.59
7.1.40.0050.00516.02
7.1.30.0000.00916.14
7.1.20.0000.01115.93
7.1.10.0030.00915.91
7.1.00.0030.03019.18
7.0.330.0080.00315.28
7.0.320.0090.00915.59
7.0.310.0030.01015.47
7.0.300.0000.00915.46
7.0.290.0080.00515.43
7.0.280.0000.01015.65
7.0.270.0070.00315.71
7.0.260.0070.00415.64
7.0.250.0030.00715.55
7.0.240.0030.01015.70
7.0.230.0000.00715.61
7.0.220.0040.01115.62
7.0.210.0100.00315.57
7.0.200.0250.00715.16
7.0.190.0030.01015.52
7.0.180.0030.00815.59
7.0.170.0090.00315.38
7.0.160.0000.01215.64
7.0.150.0030.01315.60
7.0.140.0020.04118.71
7.0.130.0050.00515.68
7.0.120.0000.01115.43
7.0.110.0070.00715.68
7.0.100.0000.01315.40
7.0.90.0030.02918.71
7.0.80.0070.04018.53
7.0.70.0050.03018.63
7.0.60.0050.03118.78
7.0.50.0070.04318.93
7.0.40.0030.04816.97
7.0.30.0070.04716.77
7.0.20.0080.04116.79
7.0.10.0070.03716.91
7.0.00.0080.03316.80
5.6.380.0030.00714.58
5.6.370.0030.01014.47
5.6.360.0000.01514.51
5.6.350.0060.00313.97
5.6.340.0070.00314.54
5.6.330.0050.00514.22
5.6.320.0100.00714.49
5.6.310.0110.00314.56
5.6.300.0040.00714.59
5.6.290.0030.00914.76
5.6.280.0080.03617.79
5.6.270.0070.00714.39
5.6.260.0060.00614.77
5.6.250.0030.00814.43
5.6.240.0100.02317.50
5.6.230.0020.04417.64
5.6.220.0060.02917.61
5.6.210.0070.04717.51
5.6.200.0140.02417.74
5.6.190.0050.04317.79
5.6.180.0020.04617.70
5.6.170.0080.03717.70
5.6.160.0050.04217.61
5.6.150.0070.04517.74
5.6.140.0080.04017.67
5.6.130.0040.02817.69
5.6.120.0070.02517.70
5.6.110.0040.04317.77
5.6.100.0050.04817.72
5.6.90.0100.04217.62
5.6.80.0050.04317.35
5.6.70.0060.03817.42
5.6.60.0020.03817.36
5.6.50.0030.03917.34
5.6.40.0000.04817.33
5.6.30.0050.04317.32
5.6.20.0050.02917.17
5.6.10.0060.04117.27
5.6.00.0050.04717.38
5.5.380.0030.02215.79
5.5.370.0030.04515.73
5.5.360.0030.04115.84
5.5.350.0110.03015.80
5.5.340.0030.04516.15
5.5.330.0050.04016.09
5.5.320.0070.03716.11
5.5.310.0080.03815.93
5.5.300.0030.03216.01
5.5.290.0030.04715.98
5.5.280.0050.04316.02
5.5.270.0020.04916.03
5.5.260.0010.04816.11
5.5.250.0020.04615.96
5.5.240.0100.03815.72
5.5.230.0050.04415.58
5.5.220.0030.03615.73
5.5.210.0030.03215.76
5.5.200.0080.03515.80
5.5.190.0040.04515.68
5.5.180.0060.04415.75
5.5.170.0040.00711.30
5.5.160.0070.04015.65
5.5.150.0090.03715.73
5.5.140.0070.03915.72
5.5.130.0030.04115.62
5.5.120.0100.03515.78
5.5.110.0020.04215.64
5.5.100.0020.04115.62
5.5.90.0050.03815.55
5.5.80.0030.03815.71
5.5.70.0020.03815.59
5.5.60.0050.04315.71
5.5.50.0080.03615.53
5.5.40.0050.03315.60
5.5.30.0000.03715.51
5.5.20.0010.04315.70
5.5.10.0050.01815.67
5.5.00.0060.04115.67
5.4.450.0070.04315.15
5.4.440.0070.03215.17
5.4.430.0020.02715.27
5.4.420.0080.03215.33
5.4.410.0060.02615.30
5.4.400.0050.02415.16
5.4.390.0070.03815.16
5.4.380.0070.03715.10
5.4.370.0040.03715.06
5.4.360.0070.03315.09
5.4.350.0020.04215.03
5.4.340.0030.04015.20
5.4.330.0060.00611.20
5.4.320.0050.04015.08
5.4.310.0020.04215.04
5.4.300.0050.04115.13
5.4.290.0010.04314.94
5.4.280.0030.04015.24
5.4.270.0030.04515.06
5.4.260.0000.02815.04
5.4.250.0030.04015.11
5.4.240.0040.03714.95
5.4.230.0030.02315.11
5.4.220.0040.02915.11
5.4.210.0050.03815.19
5.4.200.0040.03915.15
5.4.190.0030.02214.99
5.4.180.0050.02615.04
5.4.170.0060.03714.99
5.4.160.0050.03615.02
5.4.150.0080.03515.11
5.4.140.0050.03513.63
5.4.130.0090.03513.71
5.4.120.0050.03713.51
5.4.110.0020.04213.65
5.4.100.0000.04213.62
5.4.90.0050.03813.61
5.4.80.0050.03813.80
5.4.70.0030.03813.64
5.4.60.0050.02013.85
5.4.50.0040.01913.74
5.4.40.0050.03813.70
5.4.30.0060.03213.72
5.4.20.0070.03513.58
5.4.10.0040.02813.68
5.4.00.0080.03313.32
5.3.290.0070.03912.73
5.3.280.0050.03312.62
5.3.270.0000.02312.66
5.3.260.0050.04112.56
5.3.250.0050.04012.55
5.3.240.0070.03512.55
5.3.230.0020.04112.58
5.3.220.0020.03012.53
5.3.210.0020.04712.46
5.3.200.0070.03712.57
5.3.190.0030.04012.60
5.3.180.0000.04312.65
5.3.170.0060.04112.65
5.3.160.0050.03712.56
5.3.150.0030.03812.52
5.3.140.0050.02012.59
5.3.130.0060.03212.51
5.3.120.0000.04212.49
5.3.110.0030.03512.60
5.3.100.0050.03512.29
5.3.90.0020.03812.32
5.3.80.0030.02112.12
5.3.70.0000.02312.21
5.3.60.0050.03712.39
5.3.50.0030.02612.21
5.3.40.0050.02012.21
5.3.30.0040.03012.38
5.3.20.0030.02112.10
5.3.10.0070.03312.00
5.3.00.0040.04211.93
5.2.170.0020.01710.31
5.2.160.0000.02610.34
5.2.150.0020.02510.49
5.2.140.0020.01910.32
5.2.130.0030.03010.32
5.2.120.0030.03310.35
5.2.110.0030.02010.42
5.2.100.0030.02510.25
5.2.90.0060.03010.34
5.2.80.0010.01810.21
5.2.70.0020.03310.24
5.2.60.0060.03010.25
5.2.50.0000.03410.24
5.2.40.0030.03210.26
5.2.30.0000.03210.21
5.2.20.0070.03010.12
5.2.10.0020.03510.18
5.2.00.0030.03410.13
5.1.60.0010.0289.82
5.1.50.0030.0279.82
5.1.40.0030.0279.82
5.1.30.0050.0309.90
5.1.20.0020.0229.83
5.1.10.0030.0189.82
5.1.00.0020.0249.82
5.0.50.0030.0259.82
5.0.40.0020.0179.82
5.0.30.0030.0209.82
5.0.20.0040.0229.82
5.0.10.0060.0209.82
5.0.00.0020.0369.82
4.4.90.0020.0199.82
4.4.80.0000.0219.82
4.4.70.0040.0189.82
4.4.60.0020.0179.82
4.4.50.0000.0199.82
4.4.40.0030.0269.82
4.4.30.0020.0199.82
4.4.20.0030.0109.82
4.4.10.0020.0189.82
4.4.00.0020.0309.82
4.3.110.0000.0219.82
4.3.100.0010.0219.82
4.3.90.0040.0189.82
4.3.80.0060.0209.82
4.3.70.0020.0189.82
4.3.60.0030.0179.82
4.3.50.0000.0219.82
4.3.40.0030.0249.82
4.3.30.0000.0239.82
4.3.20.0000.0209.82
4.3.10.0030.0179.82
4.3.00.0020.0209.82

preferences:
42.22 ms | 401 KiB | 5 Q