3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRoundedCutoff ($t) { $time = explode(':', $t); if ( $time[2] > 30 ) { $time[1] = intval($time[1]) + 1; } if ( $time[1] >= 60 ) { $time[1] = '00'; $time[0] = $time[0] + 1; } $time[2] = '00'; $rmin = $time[1] % 15; $dt = new DateTime( implode(':', $time) ); if ( $rmin > 7 ) { $dt->add(new DateInterval('PT'.(15-$rmin).'M')); } else { $dt->sub(new DateInterval('PT'.$rmin.'M')); } return $dt->format('H:i:s'); } $times = array( '10:52:00', '10:52:59', '10:53:00', '10:50:00', '10:50:14', '10:50:59', '10:50:45', '01:12:00', '01:05:00', '01:58:00', '01:58:59', '01:59:59', '01:01:00', ); foreach ($times as $time) { var_dump($time.' -> '.getRoundedCutoff($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)
8.3.60.0110.00718.68
8.3.50.0120.01121.98
8.3.40.0110.00418.97
8.3.30.0110.00418.95
8.3.20.0040.00418.85
8.3.10.0080.00021.07
8.3.00.0080.00023.50
8.2.180.0110.00716.63
8.2.170.0060.01222.96
8.2.160.0070.00720.36
8.2.150.0080.00024.18
8.2.140.0030.00624.66
8.2.130.0030.00526.16
8.2.120.0060.00321.00
8.2.110.0050.00520.27
8.2.100.0060.00618.03
8.2.90.0000.00819.23
8.2.80.0000.00817.97
8.2.70.0060.00618.00
8.2.60.0000.00817.93
8.2.50.0090.00318.07
8.2.40.0050.00318.34
8.2.30.0030.00619.50
8.2.20.0040.00417.87
8.2.10.0050.00317.90
8.2.00.0050.00317.90
8.1.280.0070.01025.92
8.1.270.0070.00023.99
8.1.260.0060.00326.35
8.1.250.0030.00628.09
8.1.240.0030.00622.67
8.1.230.0040.00820.82
8.1.220.0000.00818.77
8.1.210.0000.00818.98
8.1.200.0070.00317.48
8.1.190.0060.00317.53
8.1.180.0030.00618.10
8.1.170.0080.00018.40
8.1.160.0070.00019.04
8.1.150.0030.00618.91
8.1.140.0040.00417.67
8.1.130.0000.00717.96
8.1.120.0050.00317.54
8.1.110.0040.00417.70
8.1.100.0080.00017.66
8.1.90.0030.00617.67
8.1.80.0020.00517.57
8.1.70.0030.00317.62
8.1.60.0000.00917.71
8.1.50.0000.00817.53
8.1.40.0080.00017.56
8.1.30.0050.00317.81
8.1.20.0000.00817.80
8.1.10.0040.00417.74
8.1.00.0000.01217.72
8.0.300.0000.00819.88
8.0.290.0040.00417.18
8.0.280.0000.00718.54
8.0.270.0040.00417.32
8.0.260.0030.00317.10
8.0.250.0000.00817.14
8.0.240.0030.00517.25
8.0.230.0000.00717.21
8.0.220.0030.00617.26
8.0.210.0040.00417.19
8.0.200.0000.00617.11
8.0.190.0070.00017.15
8.0.180.0000.00817.23
8.0.170.0000.00717.05
8.0.160.0060.00317.15
8.0.150.0000.00817.13
8.0.140.0070.00317.18
8.0.130.0000.00613.54
8.0.120.0050.00317.06
8.0.110.0040.00417.12
8.0.100.0000.00717.23
8.0.90.0050.00317.15
8.0.80.0060.01017.23
8.0.70.0030.00517.09
8.0.60.0040.00417.05
8.0.50.0040.00416.97
8.0.30.0180.00817.37
8.0.20.0050.01617.46
8.0.10.0060.00317.12
8.0.00.0110.00816.94
7.4.330.0050.00016.85
7.4.320.0030.00316.80
7.4.300.0030.00316.73
7.4.290.0000.00816.61
7.4.280.0000.00716.73
7.4.270.0080.00016.75
7.4.260.0060.00013.29
7.4.250.0040.00416.72
7.4.240.0030.00316.74
7.4.230.0050.00316.57
7.4.220.0090.01216.70
7.4.210.0080.01116.71
7.4.200.0040.00416.59
7.4.190.0070.00016.78
7.4.160.0060.01616.73
7.4.150.0120.01817.40
7.4.140.0100.00717.86
7.4.130.0110.00816.75
7.4.120.0090.01016.72
7.4.110.0120.00816.58
7.4.100.0120.01216.82
7.4.90.0120.00616.56
7.4.80.0080.00819.39
7.4.70.0110.00716.89
7.4.60.0130.00416.73
7.4.50.0000.00916.35
7.4.40.0060.00922.77
7.4.30.0060.01216.55
7.4.10.0060.01214.88
7.4.00.0050.01115.07
7.3.330.0050.00013.38
7.3.320.0030.00313.36
7.3.310.0050.00316.41
7.3.300.0000.00616.52
7.3.290.0130.00616.57
7.3.280.0120.00716.58
7.3.270.0090.00917.40
7.3.260.0110.00718.24
7.3.250.0130.00516.60
7.3.240.0060.01216.66
7.3.230.0110.01116.68
7.3.210.0080.01616.54
7.3.200.0090.01019.39
7.3.190.0090.00916.81
7.3.180.0030.01316.78
7.3.170.0060.01016.51
7.3.160.0100.00716.59
7.3.130.0030.01014.89
7.3.120.0100.00815.02
7.3.110.0070.01314.82
7.3.100.0090.00615.32
7.3.90.0130.00315.20
7.3.80.0090.00315.03
7.3.70.0050.00514.86
7.3.60.0090.00615.16
7.3.50.0060.00615.14
7.3.40.0070.00315.06
7.3.30.0060.01015.13
7.3.20.0100.01016.84
7.3.10.0120.00916.61
7.3.00.0170.00716.79
7.2.330.0100.01016.78
7.2.320.0060.01216.68
7.2.310.0120.00617.03
7.2.300.0090.01216.81
7.2.290.0150.00816.72
7.2.260.0060.01315.21
7.2.250.0090.00914.86
7.2.240.0060.01015.28
7.2.230.0070.01014.98
7.2.220.0040.01415.41
7.2.210.0000.01615.18
7.2.200.0070.00715.16
7.2.190.0090.00915.27
7.2.180.0030.01015.38
7.2.170.0070.00715.09
7.2.160.0030.00915.21
7.2.150.0060.00917.21
7.2.140.0030.00816.86
7.2.130.0170.00517.00
7.2.120.0090.01117.10
7.2.110.0120.00816.97
7.2.100.0110.01017.01
7.2.90.0120.00616.96
7.2.80.0110.00417.03
7.2.70.0140.00716.99
7.2.60.0120.00917.13
7.2.50.0160.00716.79
7.2.40.0190.00916.96
7.2.30.0120.00817.05
7.2.20.0120.00917.07
7.2.10.0050.01116.92
7.2.00.0080.00917.57
7.1.330.0040.01115.86
7.1.320.0110.00716.09
7.1.310.0140.00016.13
7.1.300.0110.00715.70
7.1.290.0070.00715.90
7.1.280.0030.01015.99
7.1.270.0090.00916.03
7.1.260.0040.01116.07
7.1.250.0120.00915.84
7.1.240.0100.00815.82
7.1.230.0090.00715.78
7.1.220.0070.00915.78
7.1.210.0080.00715.93
7.1.200.0070.00715.88
7.1.190.0100.00616.05
7.1.180.0060.00915.92
7.1.170.0130.00515.88
7.1.160.0060.00815.98
7.1.150.0050.01015.89
7.1.140.0080.00515.96
7.1.130.0080.00915.95
7.1.120.0070.00815.88
7.1.110.0050.01015.84
7.1.100.0050.00916.67
7.1.90.0070.00615.87
7.1.80.0100.00615.87
7.1.70.0040.00816.29
7.1.60.0050.00816.34
7.1.50.0030.00816.05
7.1.40.0080.00516.04
7.1.30.0090.00316.21
7.1.20.0060.00716.14
7.1.10.0080.00516.10
7.1.00.0060.00516.21
7.0.330.0090.00915.68
7.0.320.0090.00715.61
7.0.310.0070.00715.41
7.0.300.0100.00615.44
7.0.290.0060.00915.50
7.0.280.0060.01015.36
7.0.270.0070.00815.51
7.0.260.0110.00715.57
7.0.250.0060.01015.43
7.0.240.0060.00815.54
7.0.230.0080.00715.61
7.0.220.0060.00715.63
7.0.210.0070.00815.56
7.0.200.0070.00615.91
7.0.190.0080.00415.91
7.0.180.0080.00415.71
7.0.170.0040.00715.84
7.0.160.0070.00715.85
7.0.150.0030.00715.75
7.0.140.0070.00315.60
7.0.130.0060.00615.87
7.0.120.0050.00915.87
7.0.110.0040.00715.82
7.0.100.0050.00715.69
7.0.90.0060.00715.83
7.0.80.0070.00615.82
7.0.70.0060.00915.78
7.0.60.0050.00716.05
7.0.50.0080.00416.06
7.0.40.0080.00314.27
7.0.30.0030.00814.24
7.0.20.0040.00714.19
7.0.10.0040.00714.12
7.0.00.0050.00614.18
5.6.400.0000.01414.57
5.6.390.0060.01014.84
5.6.380.0080.00814.52
5.6.370.0030.01114.51
5.6.360.0080.00414.55
5.6.350.0060.00914.59
5.6.340.0090.00314.66
5.6.330.0030.00914.62
5.6.320.0060.00714.68
5.6.310.0020.01114.71
5.6.300.0080.01216.26
5.6.290.0050.02216.20
5.6.280.0040.01616.12
5.6.270.0070.01916.09
5.6.260.0060.02016.14
5.6.250.0060.01816.09
5.6.240.0080.01616.07
5.6.230.0060.01516.09
5.6.220.0040.01716.14
5.6.210.0020.02016.11
5.6.200.0040.01616.21
5.6.190.0060.01616.12
5.6.180.0050.01816.03
5.6.170.0050.01716.00
5.6.160.0050.01916.08
5.6.150.0040.01716.13
5.6.140.0070.01516.14
5.6.130.0080.02616.06
5.6.120.0040.02216.03
5.6.110.0080.02015.91
5.6.100.0060.02616.00
5.6.90.0030.01916.02
5.6.80.0060.01515.90
5.6.70.0100.01716.00
5.6.60.0070.01515.87
5.6.50.0070.01516.10
5.6.40.0030.01815.91
5.6.30.0040.01815.85
5.6.20.0060.01615.82
5.6.10.0040.01515.88
5.6.00.0060.01315.86
5.5.380.0040.01613.69
5.5.370.0050.01513.66
5.5.360.0080.01213.84
5.5.350.0030.01413.71
5.5.340.0060.01513.92
5.5.330.0030.02613.76
5.5.320.0030.01813.79
5.5.310.0090.01413.63
5.5.300.0060.01913.75
5.5.290.0060.01913.86
5.5.280.0040.02313.70
5.5.270.0030.02113.58
5.5.260.0040.02113.81
5.5.250.0060.02313.70
5.5.240.0040.01913.50
5.5.230.0090.01213.65
5.5.220.0060.01613.56
5.5.210.0030.01713.57
5.5.200.0060.01313.48
5.5.190.0060.01413.52
5.5.180.0070.01313.60
5.5.170.0080.00412.47
5.5.160.0040.01513.60
5.5.150.0040.01513.78
5.5.140.0070.01413.75
5.5.130.0060.01313.70
5.5.120.0040.01413.60
5.5.110.0020.01813.62
5.5.100.0020.02013.71
5.5.90.0040.01513.42
5.5.80.0060.01213.46
5.5.70.0050.01413.52
5.5.60.0040.01513.47
5.5.50.0110.01213.61
5.5.40.0030.01613.61
5.5.30.0050.02013.59
5.5.20.0040.01413.54
5.5.10.0030.02413.66
5.5.00.0050.01513.57
5.4.450.0020.01813.36
5.4.440.0060.02013.38
5.4.430.0050.02413.25
5.4.420.0020.01913.13
5.4.410.0040.02213.36
5.4.400.0050.01713.07
5.4.390.0060.01413.19
5.4.380.0020.01513.21
5.4.370.0060.01113.23
5.4.360.0060.01113.26
5.4.350.0070.01213.21
5.4.340.0020.01513.32
5.4.330.0050.00511.46
5.4.320.0060.01213.26
5.4.310.0060.01213.19
5.4.300.0070.01313.35
5.4.290.0050.01313.35
5.4.280.0030.01413.20
5.4.270.0030.01513.26
5.4.260.0040.01413.34
5.4.250.0030.01513.10
5.4.240.0060.01413.33
5.4.230.0040.01613.32
5.4.220.0050.01313.30
5.4.210.0030.01613.29
5.4.200.0020.01613.26
5.4.190.0050.01413.20
5.4.180.0070.01113.14
5.4.170.0040.01513.17
5.4.160.0060.01513.38
5.4.150.0040.01613.24
5.4.140.0050.01512.58
5.4.130.0030.01712.58
5.4.120.0060.01312.58
5.4.110.0030.01412.79
5.4.100.0070.01712.62
5.4.90.0070.01212.63
5.4.80.0030.01612.70
5.4.70.0050.01312.62
5.4.60.0030.01512.67
5.4.50.0040.01512.47
5.4.40.0080.01212.63
5.4.30.0030.01312.66
5.4.20.0070.01112.68
5.4.10.0050.01212.71
5.4.00.0040.01412.58
5.3.290.0050.01411.93
5.3.280.0030.01311.95
5.3.270.0010.01611.98
5.3.260.0050.01512.01
5.3.250.0040.01311.85
5.3.240.0040.01411.94
5.3.230.0040.01311.94
5.3.220.0030.01411.91
5.3.210.0020.01511.88
5.3.200.0050.01311.89
5.3.190.0040.01511.83
5.3.180.0020.01511.99
5.3.170.0010.01611.99
5.3.160.0060.01411.85
5.3.150.0070.01411.96
5.3.140.0060.01211.87
5.3.130.0020.01811.93
5.3.120.0010.01511.95
5.3.110.0020.01811.94
5.3.100.0050.01311.92
5.3.90.0040.01411.91
5.3.80.0020.01411.83
5.3.70.0040.01411.83
5.3.60.0020.01511.90
5.3.50.0050.01211.91
5.3.40.0100.01411.94
5.3.30.0050.01211.94
5.3.20.0030.01411.83
5.3.10.0040.01511.82
5.3.00.0040.01411.87
5.2.170.0030.01512.25
5.2.160.0050.01212.25
5.2.150.0040.01612.25
5.2.140.0050.01312.25
5.2.130.0050.01212.25
5.2.120.0050.01212.25
5.2.110.0020.01712.25
5.2.100.0040.01512.25
5.2.90.0020.01512.25
5.2.80.0040.01312.25
5.2.70.0010.01712.25
5.2.60.0030.01512.25
5.2.50.0070.01412.25
5.2.40.0010.01512.25
5.2.30.0050.01212.25
5.2.20.0020.01512.25
5.2.10.0030.01312.25
5.2.00.0030.01312.25
5.1.60.0040.00912.25
5.1.50.0030.01012.25
5.1.40.0020.01412.25
5.1.30.0010.01412.25
5.1.20.0020.01512.25
5.1.10.0030.01212.25
5.1.00.0040.01112.25
5.0.50.0050.00712.25
5.0.40.0030.00812.25
5.0.30.0080.01512.25
5.0.20.0040.00812.25
5.0.10.0080.00612.25
5.0.00.0020.01412.25
4.4.90.0030.00712.25
4.4.80.0020.00812.25
4.4.70.0030.00812.25
4.4.60.0030.00712.25
4.4.50.0030.00712.25
4.4.40.0030.01112.25
4.4.30.0030.00712.25
4.4.20.0020.00912.25
4.4.10.0010.00912.25
4.4.00.0030.01012.25
4.3.110.0040.00712.25
4.3.100.0020.00812.25
4.3.90.0010.00812.25
4.3.80.0040.00912.25
4.3.70.0020.01012.25
4.3.60.0020.00912.25
4.3.50.0010.01012.25
4.3.40.0030.01112.25
4.3.30.0020.00812.25
4.3.20.0010.00812.25
4.3.10.0010.00912.25
4.3.00.0040.00612.25

preferences:
44.22 ms | 401 KiB | 5 Q