3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getTime() { $arg1 = func_get_arg(0); $arg2 = func_get_arg(1); if (is_string($arg1)) { $format = $arg1; } elseif (is_string($arg2)) { $format = $arg2; } else { $format = 'H:i:s'; } if (is_int($arg1)) { $time = $arg1; } elseif (is_int($arg2)) { $time = $arg2; } else { $time = time(); } return date($format, $time); } function testGetTime() { $time = time(); $results = array( date('H:i:s', $time) === getTime($time), date('H:i:s', $time) === getTime(), date('H:i:s', $time) === getTime('H:i:s'), date('H:i', $time) === getTime('H:i', $time), date('H:i', $time) === getTime($time, 'H:i'), ); var_dump($results); } testGetTime();

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)
7.2.00.0070.00719.68
7.1.100.0030.00918.09
7.1.70.0090.00017.25
7.1.60.0100.00717.31
7.1.50.0100.01317.07
7.1.00.0070.07022.43
7.0.200.0060.00916.80
7.0.140.0070.07322.17
7.0.80.0370.07019.93
7.0.70.0500.07719.89
7.0.60.0500.07320.00
7.0.50.0400.06320.33
7.0.40.0200.06720.15
7.0.30.0100.05720.16
7.0.20.0170.03320.00
7.0.10.0100.04020.09
7.0.00.0000.08320.18
5.6.280.0100.07020.91
5.6.230.0170.08020.72
5.6.220.0170.03720.72
5.6.210.0070.08020.69
5.6.200.0170.07321.09
5.6.190.0130.07721.04
5.6.180.0070.06021.09
5.6.170.0100.08021.01
5.6.160.0030.08721.14
5.6.150.0130.06721.12
5.6.140.0030.08321.11
5.6.130.0030.09020.95
5.6.120.0100.04721.10
5.6.110.0030.09020.98
5.6.100.0030.08321.00
5.6.90.0100.08321.02
5.6.80.0100.07320.55
5.6.70.0070.08020.42
5.6.60.0130.06320.31
5.6.50.0070.08720.33
5.6.40.0100.08320.34
5.6.30.0100.08020.42
5.6.20.0000.04320.32
5.6.10.0000.05020.43
5.6.00.0130.03720.48
5.5.370.0170.05020.46
5.5.360.0170.08020.58
5.5.350.0070.08020.45
5.5.340.0100.07720.89
5.5.330.0070.08020.93
5.5.320.0070.08720.87
5.5.310.0030.06320.88
5.5.300.0030.08320.92
5.5.290.0170.08020.63
5.5.280.0100.08320.86
5.5.270.0030.07720.73
5.5.260.0070.08020.75
5.5.250.0130.08720.73
5.5.240.0070.08020.32
5.5.230.0100.08020.16
5.5.220.0070.08020.24
5.5.210.0030.07720.17
5.5.200.0170.07320.22
5.5.190.0070.06719.99
5.5.180.0030.05020.15
5.5.160.0030.04020.08
5.5.150.0030.04320.16
5.5.140.0000.04320.14
5.5.130.0100.03320.16
5.5.120.0030.04020.07
5.5.110.0070.04720.17
5.5.100.0130.05720.07
5.5.90.0070.04720.07
5.5.80.0070.03720.09
5.5.70.0130.04020.01
5.5.60.0100.03720.03
5.5.50.0000.04720.16
5.5.40.0070.04020.05
5.5.30.0070.05720.14
5.5.20.0070.05320.07
5.5.10.0030.05320.03
5.5.00.0070.03719.97
5.4.450.0070.05719.46
5.4.440.0100.05719.20
5.4.430.0030.09019.20
5.4.420.0170.06719.16
5.4.410.0200.07019.26
5.4.400.0030.08719.14
5.4.390.0100.06718.85
5.4.380.0100.05319.18
5.4.370.0000.08319.18
5.4.360.0070.08319.03
5.4.350.0030.07019.23
5.4.340.0030.04019.03
5.4.320.0070.04319.23
5.4.310.0030.04019.05
5.4.300.0170.03319.04
5.4.290.0030.04319.25
5.4.280.0000.04319.13
5.4.270.0030.07719.02
5.4.260.0130.06018.84
5.4.250.0000.04718.91
5.4.240.0000.05319.17
5.4.230.0100.07318.84
5.4.220.0170.04719.04
5.4.210.0100.03718.96
5.4.200.0030.04019.04
5.4.190.0070.07319.02
5.4.180.0000.04319.16
5.4.170.0030.04019.13
5.4.160.0030.05019.16
5.4.150.0030.04018.89
5.4.140.0030.03716.46
5.4.130.0100.04716.50
5.4.120.0030.03716.38
5.4.110.0000.04016.44
5.4.100.0070.05716.61
5.4.90.0000.05716.54
5.4.80.0000.04016.36
5.4.70.0070.03316.53
5.4.60.0070.06016.38
5.4.50.0000.04716.31
5.4.40.0100.07016.38
5.4.30.0030.06716.36
5.4.20.0030.03716.32
5.4.10.0070.03316.45
5.4.00.0100.05715.97
5.3.290.0100.03315.97
5.3.280.0070.04715.97
5.3.270.0070.04015.97
5.3.260.0000.06715.97
5.3.250.0000.04015.97
5.3.240.0100.03715.97
5.3.230.0070.04015.97
5.3.220.0100.03015.97
5.3.210.0030.04315.97
5.3.200.0000.04315.97
5.3.190.0030.05015.97
5.3.180.0000.04315.97
5.3.170.0030.03715.97
5.3.160.0000.04315.97
5.3.150.0070.04015.97
5.3.140.0030.03715.97
5.3.130.0000.04715.97
5.3.120.0000.05015.97
5.3.110.0030.06015.97
5.3.100.0000.06015.97
5.3.90.0030.03715.97
5.3.80.0030.05015.97
5.3.70.0030.05315.97
5.3.60.0100.06315.97
5.3.50.0000.06015.97
5.3.40.0030.04015.97
5.3.30.0000.04015.97
5.3.20.0030.06715.97
5.3.10.0130.06715.97
5.3.00.0130.07015.97
5.2.170.0030.03315.97
5.2.160.0030.04315.97
5.2.150.0000.03315.97
5.2.140.0030.03715.97
5.2.130.0030.06315.97
5.2.120.0070.06015.97
5.2.110.0030.06015.97
5.2.100.0100.06015.97
5.2.90.0000.06715.97
5.2.80.0030.06315.97
5.2.70.0070.05315.97
5.2.60.0100.04315.97
5.2.50.0130.05015.97
5.2.40.0000.06715.97
5.2.30.0070.06015.97
5.2.20.0030.06315.97
5.2.10.0170.04715.97
5.2.00.0030.06315.97
5.1.60.0070.05015.97
5.1.50.0070.04715.97
5.1.40.0030.05715.97
5.1.30.0100.05015.97
5.1.20.0100.04715.97
5.1.10.0100.05315.97
5.1.00.0100.05015.97
5.0.50.0070.04315.97
5.0.40.0100.03315.97
5.0.30.0000.03715.97
5.0.20.0000.03715.97
5.0.10.0000.04015.97
5.0.00.0100.06015.97
4.4.90.0030.03315.97
4.4.80.0000.03715.97
4.4.70.0000.04015.97
4.4.60.0030.03715.97
4.4.50.0030.03315.97
4.4.40.0000.06015.97
4.4.30.0030.03715.97
4.4.20.0030.03715.97
4.4.10.0070.03315.97
4.4.00.0070.05315.97
4.3.110.0030.02015.97
4.3.100.0000.03715.97
4.3.90.0100.02715.97
4.3.80.0100.04715.97
4.3.70.0000.03715.97
4.3.60.0030.03015.97
4.3.50.0030.03715.97
4.3.40.0030.05315.97
4.3.30.0000.03315.97
4.3.20.0000.04015.97
4.3.10.0000.04015.97
4.3.00.0070.02715.97

preferences:
28.28 ms | 401 KiB | 5 Q