3v4l.org

run code in 300+ PHP versions simultaneously
<?php function perfect_time($time) { $time = strtotime($time); return is_numeric($time) && $time >= 1 ? $time - time() : false; } function zone2time($zone_offset) { return @preg_match("/^([\\+\\-]{1})?([0-9]{1,2}):([0-9]{1,2})$/i", preg_replace("/[a-z\\s]+/", null, strtolower($zone_offset)), $out) ? perfect_time("{$out[2]} Hours {$out[3]} Mins" . ($out[1] === "-" ? " ago" : null)) : false; } var_dump(zone2time(" GMT 05 : 30 "));

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.1.70.0000.00817.67
7.1.60.0030.01519.82
7.1.50.0030.01017.40
7.1.00.0030.05022.48
7.0.200.0080.00016.94
7.0.140.0100.06722.05
7.0.90.0130.08721.69
7.0.80.0030.08321.65
7.0.70.0100.08021.66
7.0.60.0030.07721.73
7.0.50.0130.08022.12
7.0.40.0070.08720.04
7.0.30.0000.08320.10
7.0.20.0170.07720.05
7.0.10.0100.08020.03
7.0.00.0070.08020.18
5.6.280.0070.07321.13
5.6.240.0070.07020.67
5.6.230.0070.08020.60
5.6.220.0070.05020.57
5.6.210.0070.07320.77
5.6.200.0070.08321.05
5.6.190.0030.06021.18
5.6.180.0070.08021.08
5.6.170.0100.08021.05
5.6.160.0030.08321.05
5.6.150.0070.07721.07
5.6.140.0070.08020.94
5.6.130.0100.08321.06
5.6.120.0030.08320.94
5.6.110.0170.06321.04
5.6.100.0030.06321.13
5.6.90.0130.06321.12
5.6.80.0000.08020.43
5.6.70.0130.06720.44
5.6.60.0030.04720.49
5.6.50.0030.08320.40
5.6.40.0130.07320.44
5.6.30.0070.06720.33
5.6.20.0030.05020.45
5.6.10.0100.08320.42
5.6.00.0070.08020.29
5.5.380.0070.04720.34
5.5.370.0070.06020.43
5.5.360.0030.05720.42
5.5.350.0170.05320.34
5.5.340.0000.06320.93
5.5.330.0070.08320.84
5.5.320.0170.07720.93
5.5.310.0100.07720.78
5.5.300.0100.07720.83
5.5.290.0130.08020.83
5.5.280.0100.04320.92
5.5.270.0030.04720.63
5.5.260.0130.07320.64
5.5.250.0030.06320.57
5.5.240.0070.08020.32
5.5.230.0170.07020.19
5.5.220.0000.08020.27
5.5.210.0000.08320.21
5.5.200.0170.05020.16
5.5.190.0070.05020.28
5.5.180.0070.05320.26
5.5.160.0130.07320.12
5.5.150.0130.07720.00
5.5.140.0070.06720.24
5.5.130.0030.04720.24
5.5.120.0070.04320.23
5.5.110.0270.05720.23
5.5.100.0100.06320.09
5.5.90.0130.07320.13
5.5.80.0100.07019.95
5.5.70.0170.04020.09
5.5.60.0100.07720.06
5.5.50.0070.07320.15
5.5.40.0070.08020.14
5.5.30.0070.05319.95
5.5.20.0100.06720.16
5.5.10.0100.05720.11
5.5.00.0070.05720.08
5.4.450.0130.07719.46
5.4.440.0100.07719.20
5.4.430.0100.03319.45
5.4.420.0070.04019.36
5.4.410.0200.06019.23
5.4.400.0000.08018.95
5.4.390.0070.03719.05
5.4.380.0030.05019.04
5.4.370.0070.07319.09
5.4.360.0070.08319.03
5.4.350.0030.05718.90
5.4.340.0070.04719.23
5.4.320.0100.05019.04
5.4.310.0070.07718.85
5.4.300.0170.06018.84
5.4.290.0100.07719.18
5.4.280.0030.07719.12
5.4.270.0070.08018.94
5.4.260.0070.07719.20
5.4.250.0030.07319.22
5.4.240.0070.04019.19
5.4.230.0070.04719.15
5.4.220.0000.06719.02
5.4.210.0130.07319.09
5.4.200.0100.07018.89
5.4.190.0070.07318.83
5.4.180.0030.08019.11
5.4.170.0070.05318.84
5.4.160.0070.06718.83
5.4.150.0000.07019.02
5.4.140.0100.07316.34
5.4.130.0030.03316.49
5.4.120.0000.04016.34
5.4.110.0000.03716.49
5.4.100.0000.04016.52
5.4.90.0000.03716.48
5.4.80.0000.04316.53
5.4.70.0070.03016.38
5.4.60.0000.03716.38
5.4.50.0000.03716.32
5.4.40.0000.03716.46
5.4.30.0030.03716.26
5.4.20.0000.03716.29
5.4.10.0000.04716.36
5.4.00.0030.05015.84
5.3.290.0030.08014.66
5.3.280.0130.07014.70
5.3.270.0030.07714.57
5.3.260.0100.07014.71
5.3.250.0100.07014.54
5.3.240.0030.06314.62
5.3.230.0000.04014.72
5.3.220.0000.04014.70
5.3.210.0030.03714.50
5.3.200.0030.04314.66
5.3.190.0030.04014.54
5.3.180.0000.04014.50
5.3.170.0030.05014.52
5.3.160.0030.07314.58
5.3.150.0030.03314.55
5.3.140.0000.04014.50
5.3.130.0000.04314.50
5.3.120.0000.04014.61
5.3.110.0000.04014.68
5.3.100.0000.05314.10
5.3.90.0000.03714.14
5.3.80.0030.04314.05
5.3.70.0030.03314.13
5.3.60.0000.03714.09
5.3.50.0030.03313.93
5.3.40.0030.06013.95
5.3.30.0030.03713.90
5.3.20.0030.03713.82
5.3.10.0030.03313.55
5.3.00.0000.04013.73
5.2.170.0030.06013.42
5.2.160.0000.05313.42
5.2.150.0030.04713.42
5.2.140.0030.04313.42
5.2.130.0000.03713.42
5.2.120.0030.03713.42
5.2.110.0070.02313.42
5.2.100.0030.03013.42
5.2.90.0030.02713.42
5.2.80.0070.03013.42
5.2.70.0000.03013.42
5.2.60.0000.03013.42
5.2.50.0000.03013.42
5.2.40.0000.02713.42
5.2.30.0000.03313.42
5.2.20.0070.03313.42
5.2.10.0000.03013.42
5.2.00.0000.03013.42
5.1.60.0000.03713.42
5.1.50.0030.01713.42
5.1.40.0000.02313.42
5.1.30.0030.03713.42
5.1.20.0000.02713.42
5.1.10.0000.03313.42
5.1.00.0000.02713.42
5.0.50.0000.02013.42
5.0.40.0000.01713.42
5.0.30.0000.03013.42
5.0.20.0000.03013.42
5.0.10.0030.03013.42
5.0.00.0000.04313.42
4.4.90.0000.01313.42
4.4.80.0000.01713.42
4.4.70.0000.03013.42
4.4.60.0000.02313.42
4.4.50.0000.01313.42
4.4.40.0000.03313.42
4.4.30.0000.01313.42
4.4.20.0030.01313.42
4.4.10.0000.01713.42
4.4.00.0000.02313.42
4.3.110.0000.02013.42
4.3.100.0000.01313.42
4.3.90.0000.02013.42
4.3.80.0000.03313.42
4.3.70.0000.02013.42
4.3.60.0030.01713.42
4.3.50.0000.02013.42
4.3.40.0000.02713.42
4.3.30.0000.01713.42
4.3.20.0000.02713.42
4.3.10.0000.03313.42
4.3.00.0030.03713.42

preferences:
35.38 ms | 400 KiB | 5 Q