3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRoundedCutoff ($cutoff) { $dt = new DateTime( $cutoff ); $sec = intval($dt->format('s')); $min = intval($dt->format('i')); $rmin = $min % 15; if ( $sec > 30 ) { $dt->add(new DateInterval('PT'.(60-$sec).'S')); } else { $dt->sub(new DateInterval('PT'.$sec.'S')); } 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:50:00', '10:50:14', '10:50:59', '10:50:45', '01:12:00', '01:05:00', '01:58:00', '01:58: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.0130.00318.46
8.3.50.0080.01017.54
8.3.40.0120.00318.85
8.3.30.0100.00318.92
8.3.20.0040.00418.89
8.3.10.0040.00419.03
8.3.00.0070.00319.51
8.2.180.0110.00416.75
8.2.170.0200.00022.96
8.2.160.0050.01019.14
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0050.00221.04
8.2.110.0070.00320.95
8.2.100.0040.00817.91
8.2.90.0040.00419.35
8.2.80.0050.00318.05
8.2.70.0060.00317.88
8.2.60.0080.00017.93
8.2.50.0000.00818.03
8.2.40.0040.00419.24
8.2.30.0000.00917.86
8.2.20.0030.00617.90
8.2.10.0000.00817.96
8.2.00.0060.00317.83
8.1.270.0050.00323.99
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.75
8.1.230.0040.00817.96
8.1.220.0030.00617.91
8.1.210.0030.00518.77
8.1.200.0030.00717.38
8.1.190.0090.00017.38
8.1.180.0050.00318.72
8.1.170.0050.00317.62
8.1.160.0070.00019.01
8.1.150.0040.00418.80
8.1.140.0040.00417.63
8.1.130.0040.00417.68
8.1.120.0040.00417.59
8.1.110.0030.00517.65
8.1.100.0040.00417.74
8.1.90.0040.00417.54
8.1.80.0040.00417.68
8.1.70.0000.00817.63
8.1.60.0000.00817.71
8.1.50.0050.00317.61
8.1.40.0030.00617.71
8.1.30.0040.00417.79
8.1.20.0040.00417.76
8.1.10.0040.00417.63
8.1.00.0000.00817.62
8.0.300.0040.00818.77
8.0.290.0050.00316.75
8.0.280.0030.00318.57
8.0.270.0030.00617.37
8.0.260.0060.00016.98
8.0.250.0040.00417.20
8.0.240.0050.00217.24
8.0.230.0080.00017.22
8.0.220.0040.00417.14
8.0.210.0000.00817.11
8.0.200.0040.00417.19
8.0.190.0030.00617.07
8.0.180.0040.00417.11
8.0.170.0080.00017.00
8.0.160.0040.00417.21
8.0.150.0040.00416.94
8.0.140.0080.00016.92
8.0.130.0090.00013.49
8.0.120.0000.01017.12
8.0.110.0040.00416.99
8.0.100.0070.00017.02
8.0.90.0040.00417.07
8.0.80.0090.00617.13
8.0.70.0070.00017.12
8.0.60.0000.00816.94
8.0.50.0060.00317.16
8.0.30.0130.00717.26
8.0.20.0100.01617.52
8.0.10.0000.00817.25
8.0.00.0080.01116.84
7.4.330.0000.00513.16
7.4.320.0060.00016.68
7.4.300.0000.00616.70
7.4.290.0040.00416.69
7.4.280.0050.00316.65
7.4.270.0050.00316.75
7.4.260.0000.00613.36
7.4.250.0000.00816.58
7.4.240.0000.00816.72
7.4.230.0030.00316.78
7.4.220.0100.01716.72
7.4.210.0030.01816.71
7.4.200.0000.00716.79
7.4.190.0040.00416.53
7.4.160.0160.00016.85
7.4.150.0150.00416.66
7.4.140.0090.00917.86
7.4.130.0070.01816.65
7.4.120.0120.00616.73
7.4.110.0110.00716.68
7.4.100.0150.00316.64
7.4.90.0080.01016.66
7.4.80.0090.00919.39
7.4.70.0060.01016.65
7.4.60.0040.01216.82
7.4.50.0030.00316.67
7.4.40.0060.00916.39
7.4.30.0100.00616.59
7.4.00.0100.00715.18
7.3.330.0030.00313.24
7.3.320.0000.00813.29
7.3.310.0050.00316.41
7.3.300.0000.00816.42
7.3.290.0090.00616.44
7.3.280.0030.01016.46
7.3.270.0120.00616.59
7.3.260.0120.00616.64
7.3.240.0070.01016.48
7.3.230.0030.01416.69
7.3.210.0130.00316.79
7.3.200.0070.01016.70
7.3.190.0130.00316.62
7.3.180.0120.00416.68
7.3.170.0140.00516.62
7.3.160.0060.01616.81
7.3.120.0000.01714.89
7.3.110.0090.00914.99
7.3.100.0100.00615.05
7.3.90.0050.00514.88
7.3.80.0090.00615.35
7.3.70.0100.00714.98
7.3.60.0090.00915.11
7.3.50.0030.01014.83
7.3.40.0100.00314.80
7.3.30.0070.00715.04
7.3.20.0160.00316.88
7.3.10.0100.01016.89
7.3.00.0070.00716.88
7.2.330.0100.01017.00
7.2.320.0150.00316.79
7.2.310.0100.00717.03
7.2.300.0030.01416.79
7.2.290.0090.00916.97
7.2.250.0040.01615.27
7.2.240.0090.01215.42
7.2.230.0060.00915.00
7.2.220.0030.00615.26
7.2.210.0000.01315.53
7.2.200.0040.01415.28
7.2.190.0120.00615.38
7.2.180.0100.00714.98
7.2.170.0000.01615.11
7.2.60.0060.00617.14
7.2.00.0090.00319.68
7.1.330.0030.01015.88
7.1.320.0030.01015.93
7.1.310.0070.01016.09
7.1.300.0030.01015.84
7.1.290.0040.00716.04
7.1.280.0030.01216.04
7.1.270.0030.00615.81
7.1.260.0100.00715.88
7.1.200.0000.00915.76
7.1.100.0110.00018.01
7.1.70.0040.00417.29
7.1.60.0140.01119.25
7.1.50.0100.01017.04
7.1.00.0000.06722.38
7.0.200.0050.00216.65
7.0.140.0030.07321.94
7.0.120.0030.06322.12
7.0.60.0130.07319.95
7.0.50.0100.07317.99
7.0.40.0000.06019.98
7.0.30.0300.07720.26
7.0.20.0370.08020.09
7.0.10.0230.04720.07
7.0.00.0070.04020.11
5.6.280.0030.07021.12
5.6.210.0130.07020.55
5.6.200.0030.05318.22
5.6.190.0000.05720.41
5.6.180.0330.07720.65
5.6.170.0330.06720.56
5.6.160.0030.05320.61
5.6.150.0100.03318.25
5.6.140.0100.08318.23
5.6.130.0070.03718.30
5.6.120.0000.06720.97
5.6.110.0100.08020.99
5.6.100.0130.08021.10
5.6.90.0030.04321.01
5.6.80.0130.07720.39
5.6.70.3000.04020.41
5.5.350.0230.08020.45
5.5.340.0100.03318.09
5.5.330.0030.04020.37
5.5.320.0170.04020.32
5.5.310.0500.07320.34
5.5.300.0170.07317.98
5.5.290.0100.07718.08
5.5.280.0100.08020.89
5.5.270.0130.06020.78
5.5.260.0070.07720.80
5.5.250.0100.05720.63
5.5.240.0100.06720.20
5.4.450.0870.02719.50
5.4.440.0670.03719.57
5.4.430.0170.02719.55
5.4.420.0170.04319.15
5.4.410.0570.04319.51
5.4.400.0100.03319.16
5.4.390.0300.04019.16
5.4.380.0370.04719.04
5.4.370.0570.03319.04
5.4.360.0330.04019.07
5.4.350.0430.04719.13
5.4.340.0100.03019.23
5.4.320.0530.04019.04
5.4.310.0130.03318.86
5.4.300.0130.04018.86
5.4.290.0330.03718.96
5.4.280.0070.05019.04
5.4.270.0070.04319.21
5.4.260.0330.04019.13
5.4.250.0670.03318.94
5.4.240.0300.04719.05
5.4.230.0330.05019.21
5.4.220.0500.04719.12
5.4.210.0430.05319.04
5.4.200.0700.05019.25
5.4.190.0200.05018.96
5.4.180.0570.04018.98
5.4.170.0400.04718.93
5.4.160.0070.04019.30
5.4.150.0070.04019.30
5.4.140.0200.03016.39
5.4.130.0630.02716.55
5.4.120.0670.03316.71
5.4.110.0570.04016.63
5.4.100.0630.03316.48
5.4.90.0370.04316.43
5.4.80.0430.03716.39
5.4.70.0330.03316.55
5.4.60.0330.04316.36
5.4.50.0500.04016.49
5.4.40.0670.03316.33
5.4.30.0470.03716.35
5.4.20.0500.04016.53
5.4.10.0400.03316.55
5.4.00.0370.03015.85
5.3.290.0100.03715.28
5.3.280.0130.03015.28
5.3.270.0300.04015.28
5.3.260.0070.07015.30
5.3.250.0130.03015.30
5.3.240.0300.02315.30
5.3.230.0730.03715.30
5.3.220.0300.03315.30
5.3.210.0400.05315.30
5.3.200.0570.04315.30
5.3.190.0570.04015.30
5.3.180.0630.04015.30
5.3.170.0870.02315.30
5.3.160.0570.04715.30
5.3.150.0400.04315.30
5.3.140.0130.05015.30
5.3.130.0470.04315.30
5.3.120.0270.05015.30
5.3.110.0100.03715.30
5.3.100.0570.04315.30
5.3.90.0470.04715.30
5.3.80.0100.04715.30
5.3.70.0630.03715.30
5.3.60.0200.03715.30
5.3.50.0470.03315.30
5.3.40.0370.03715.30
5.3.30.0570.02715.30
5.3.20.0370.03715.30
5.3.10.0600.04015.30
5.3.00.0600.03715.30
5.2.170.0430.02715.30
5.2.160.0270.03015.30
5.2.150.0570.02715.30
5.2.140.0600.03015.30
5.2.130.0870.02715.30
5.2.120.0500.02715.30
5.2.110.0130.03015.30
5.2.100.0400.02715.30
5.2.90.0030.02315.30
5.2.80.0500.03015.30
5.2.70.0670.03315.30
5.2.60.0370.02715.30
5.2.50.0600.02715.30
5.2.40.0630.01715.30
5.2.30.0370.03315.30
5.2.20.0300.02715.30
5.2.10.0570.02315.30
5.2.00.0300.02715.30
5.1.60.0100.02715.30
5.1.50.0270.02315.30
5.1.40.0270.02315.30
5.1.30.0230.02715.30
5.1.20.0230.02715.30
5.1.10.0170.02015.30
5.1.00.0430.02715.30
5.0.50.0170.02015.30
5.0.40.0430.02315.30
5.0.30.0170.03715.30
5.0.20.0130.02015.30
5.0.10.0200.02315.30
5.0.00.0070.03015.29
4.4.90.0130.01715.30
4.4.80.0030.01315.30
4.4.70.0170.01315.30
4.4.60.0030.01715.30
4.4.50.0200.01715.30
4.4.40.0170.02315.30
4.4.30.0100.01015.30
4.4.20.0100.01315.30
4.4.10.0070.02015.30
4.4.00.0300.02015.30
4.3.110.0170.02315.30
4.3.100.0170.01315.30
4.3.90.0330.01015.30
4.3.80.0230.02015.29
4.3.70.0030.02015.29
4.3.60.0130.01015.29
4.3.50.0170.02315.29
4.3.40.0170.02015.29
4.3.30.0100.01315.29
4.3.20.0030.01715.29
4.3.10.0000.02015.29
4.3.00.0030.01715.29

preferences:
58.68 ms | 400 KiB | 5 Q