3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*$a = '12:21'; $b = '17:00'; $c = '09:00'; $d = '13:53'; $t1 = convertToSeconds(getTimeDiff($a,$b)); echo "\n"; $t2 = convertToSeconds(getTimeDiff($c,$d)); echo "\n"; echo gmdate("H:i",$t1+$t2);*/ $d = 4371960; $h = int($d/3600); $m = int(($d%3600)/60); echo "son $h:$m"; function convertToSeconds($time){ $a = explode(":", $time); $hora = $a[0]; $min = $a[1]; return $hora*3600+$min*60; } function getTimeDiff($dtime,$atime){ $nextDay=$dtime>$atime?1:0; $dep=explode(':',$dtime); $arr=explode(':',$atime); $diff=abs(mktime($dep[0],$dep[1],0,date('n'),date('j'),date('y'))-mktime($arr[0],$arr[1],0,date('n'),date('j')+$nextDay,date('y'))); $hours=floor($diff/(60*60)); $mins=floor(($diff-($hours*60*60))/(60)); $secs=floor(($diff-(($hours*60*60)+($mins*60)))); if(strlen($hours)<2){ $hours="0".$hours; } if(strlen($mins)<2){ $mins="0".$mins; } if(strlen($secs)<2){ $secs="0".$secs; } return $hours.':'.$mins.':'.$secs; }

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.0070.01118.31
8.3.50.0200.00521.13
8.3.40.0110.01118.71
8.3.30.0140.00718.79
8.3.20.0120.00620.34
8.3.10.0190.00021.82
8.3.00.0060.00921.91
8.2.180.0120.00618.26
8.2.170.0040.01522.96
8.2.160.0090.00620.41
8.2.150.0050.00224.18
8.2.140.0000.00824.66
8.2.130.0060.00626.16
8.2.120.0080.00017.63
8.2.110.0030.00620.97
8.2.100.0110.00017.84
8.2.90.0050.00321.13
8.2.80.0030.00618.21
8.2.70.0040.00417.80
8.2.60.0030.00718.04
8.2.50.0090.00318.10
8.2.40.0050.00320.64
8.2.30.0060.00320.64
8.2.20.0000.00717.67
8.2.10.0040.00417.98
8.2.00.0030.00518.12
8.1.280.0110.00725.92
8.1.270.0090.00024.66
8.1.260.0060.00926.35
8.1.250.0040.00428.09
8.1.240.0030.00622.47
8.1.230.0090.00321.04
8.1.220.0090.00017.74
8.1.210.0000.00818.77
8.1.200.0040.00417.25
8.1.190.0080.00017.38
8.1.180.0050.00318.10
8.1.170.0050.00318.52
8.1.160.0080.00022.19
8.1.150.0030.00718.79
8.1.140.0030.00717.44
8.1.130.0000.00717.59
8.1.120.0030.00417.41
8.1.110.0000.00817.42
8.1.100.0040.00417.32
8.1.90.0030.00517.34
8.1.80.0000.00817.36
8.1.70.0000.00717.37
8.1.60.0030.00617.53
8.1.50.0000.00917.52
8.1.40.0000.00817.56
8.1.30.0040.00417.65
8.1.20.0040.00417.63
8.1.10.0030.00617.57
8.1.00.0060.00317.56
8.0.300.0030.00519.93
8.0.290.0030.00616.75
8.0.280.0000.00718.40
8.0.270.0030.00317.18
8.0.260.0000.00717.21
8.0.250.0000.00817.01
8.0.240.0070.00016.97
8.0.230.0000.00716.92
8.0.220.0000.00716.95
8.0.210.0020.00516.87
8.0.200.0100.00016.91
8.0.190.0000.00916.98
8.0.180.0000.00816.91
8.0.170.0060.00316.99
8.0.160.0000.00716.98
8.0.150.0000.00816.87
8.0.140.0040.00416.80
8.0.130.0060.00013.34
8.0.120.0030.00516.77
8.0.110.0040.00416.75
8.0.100.0000.00716.81
8.0.90.0040.00416.70
8.0.80.0120.00316.92
8.0.70.0040.00416.73
8.0.60.0050.00516.94
8.0.50.0040.00416.78
8.0.30.0020.01617.04
8.0.20.0110.00817.40
8.0.10.0000.00916.82
8.0.00.0100.00816.68
7.4.330.0060.00015.08
7.4.320.0030.00516.58
7.4.300.0000.00616.60
7.4.290.0060.00016.61
7.4.280.0070.00016.46
7.4.270.0070.00016.62
7.4.260.0070.00016.64
7.4.250.0030.00316.55
7.4.240.0020.00516.62
7.4.230.0000.00716.73
7.4.220.0130.01316.70
7.4.210.0090.00616.63
7.4.200.0040.00416.43
7.4.160.0060.00916.47
7.4.150.0100.00717.40
7.4.140.0100.01017.86
7.4.130.0090.00816.45
7.4.120.0090.00916.59
7.4.110.0060.01216.73
7.4.100.0090.01316.75
7.4.90.0100.01316.69
7.4.80.0140.00319.39
7.4.70.0120.00416.51
7.4.60.0100.00716.65
7.4.50.0030.00616.58
7.4.40.0110.00716.57
7.4.30.0070.01416.33
7.4.00.0060.01014.88
7.3.330.0050.00013.11
7.3.320.0000.00513.14
7.3.310.0070.00016.16
7.3.300.0000.00716.36
7.3.290.0060.01016.34
7.3.280.0090.00316.33
7.3.270.0170.00017.40
7.3.260.0130.01016.34
7.3.250.0080.01116.45
7.3.240.0160.00716.64
7.3.230.0140.00416.64
7.3.210.0070.01116.50
7.3.200.0120.00616.50
7.3.190.0170.01716.52
7.3.180.0100.00716.34
7.3.170.0100.01016.38
7.3.160.0170.00016.34
7.2.330.0070.01016.73
7.2.320.0130.01016.43
7.2.310.0070.01116.60
7.2.300.0110.01016.29
7.2.290.0110.01016.57
7.2.60.0000.01616.51
7.2.00.0060.00619.28
7.1.200.0130.00015.42
7.1.100.0060.00618.07
7.1.70.0040.00417.00
7.1.60.0140.01119.29
7.1.50.0120.00916.95
7.1.00.0070.07322.45
7.0.200.0040.00416.34
7.0.80.0630.08019.97
7.0.70.0530.07319.86
7.0.60.0630.07020.00
7.0.50.0670.08320.26
7.0.40.0130.07020.11
7.0.30.0100.06719.99
7.0.20.0130.07720.04
7.0.10.0100.04320.05
7.0.00.0070.04020.10
5.6.280.0000.03321.12
5.6.230.0100.08020.61
5.6.220.0070.04720.50
5.6.210.0170.06320.60
5.6.200.0070.08320.97
5.6.190.0030.04721.02
5.6.180.0130.07321.09
5.6.170.0070.08021.15
5.6.160.0070.05021.07
5.6.150.0030.09021.19
5.6.140.0030.08721.12
5.6.130.0100.06321.03
5.6.120.0100.08721.02
5.6.110.0170.06320.89
5.6.100.0070.07721.05
5.6.90.0070.08721.10
5.6.80.0070.05720.42
5.6.70.0070.05020.37
5.6.60.0130.07320.56
5.6.50.0130.03720.52
5.6.40.0200.06720.40
5.6.30.0100.07320.32
5.6.20.0100.07720.40
5.6.10.0030.08720.33
5.6.00.0130.07720.40
5.5.370.0030.05020.39
5.5.360.0200.07020.36
5.5.350.0130.08320.35
5.5.340.0030.06020.92
5.5.330.0170.07720.92
5.5.320.0100.08020.89
5.5.310.0070.05020.75
5.5.300.0070.09020.80
5.5.290.0100.07720.88
5.5.280.0030.05020.88
5.5.270.0100.05320.74
5.5.260.0130.08020.72
5.5.250.0070.08320.68
5.5.240.0000.08720.13
5.5.230.0130.07020.19
5.5.220.0030.06720.30
5.5.210.0070.06720.27
5.5.200.0070.07020.27
5.5.190.0030.05720.23
5.5.180.0100.07720.20
5.5.160.0100.08020.18
5.5.150.0030.06020.27
5.5.140.0170.07020.20
5.5.130.0100.07720.29
5.5.120.0100.07020.23
5.5.110.0100.06320.11
5.5.100.0030.04720.09
5.5.90.0100.07320.13
5.5.80.0130.06720.08
5.5.70.0100.07720.08
5.5.60.0130.07020.07
5.5.50.0100.06720.05
5.5.40.0130.07320.17
5.5.30.0100.06720.16
5.5.20.0070.06720.07
5.5.10.0100.05020.14
5.5.00.0170.05020.05
5.4.450.0100.07319.15
5.4.440.0100.07719.36
5.4.430.0070.07319.37
5.4.420.0030.05719.50
5.4.410.0100.07319.43
5.4.400.0100.07019.03
5.4.390.0070.07719.15
5.4.380.0030.07319.20
5.4.370.0030.06319.20
5.4.360.0000.04319.20
5.4.350.0000.06019.03
5.4.340.0070.07719.04
5.4.320.0100.08019.04
5.4.310.0070.07719.20
5.4.300.0130.06719.03
5.4.290.0070.04719.12
5.4.280.0130.07019.04
5.4.270.0100.07319.03
5.4.260.0070.06719.22
5.4.250.0100.06019.05
5.4.240.0070.07319.02
5.4.230.0130.07319.04
5.4.220.0000.09019.11
5.4.210.0130.06719.22
5.4.200.0030.08019.04
5.4.190.0070.07019.17
5.4.180.0070.07019.03
5.4.170.0130.07019.10
5.4.160.0100.06719.07
5.4.150.0070.08019.07
5.4.140.0130.04316.52
5.4.130.0100.05716.24
5.4.120.0170.06316.44
5.4.110.0030.07716.38
5.4.100.0070.05016.54
5.4.90.0130.07316.38
5.4.80.0070.07016.43
5.4.70.0100.06716.50
5.4.60.0070.07716.41
5.4.50.0000.05016.47
5.4.40.0000.08016.32
5.4.30.0000.06316.43
5.4.20.0070.06316.40
5.4.10.0130.06316.47
5.4.00.0170.06315.87

preferences:
49.12 ms | 401 KiB | 5 Q