3v4l.org

run code in 300+ PHP versions simultaneously
<?php $version="v1.2.124.0bcd4d"; $fullVersion = $version; $version = trim($version); if (null === $fullVersion) { $fullVersion = $version; } // ignore aliases and just assume the alias is required instead of the source if (preg_match('{^([^,\s]+) +as +([^,\s]+)$}', $version, $match)) { $version = $match[1]; } // ignore build metadata if (preg_match('{^([^,\s+]+)\+[^\s]+$}', $version, $match)) { $version = $match[1]; } // match master-like branches if (preg_match('{^(?:dev-)?(?:master|trunk|default)$}i', $version)) { return '9999999-dev'; } if ('dev-' === strtolower(substr($version, 0, 4))) { return 'dev-'.substr($version, 4); } print_r($fullVersion); // match classical versioning if (preg_match('{^v?(\d{1,3})(\.\d+)?(\.\d+)?(\.\d+)?$}i', $version, $matches)) { $version = $matches[1] .(!empty($matches[2]) ? $matches[2] : '.0') .(!empty($matches[3]) ? $matches[3] : '.0') .(!empty($matches[4]) ? $matches[4] : '.0'); $index = 5; } elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3})?)$}i', $version, $matches)) { // match date-based versioning $version = preg_replace('{\D}', '-', $matches[1]); $index = 2; } elseif (preg_match('{^v?(\d{4,})(\.\d+)?(\.\d+)?(\.\d+)?$}i', $version, $matches)) { $version = $matches[1] .(!empty($matches[2]) ? $matches[2] : '.0') .(!empty($matches[3]) ? $matches[3] : '.0') .(!empty($matches[4]) ? $matches[4] : '.0'); $index = 5; } // add version modifiers if a version was matched if (isset($index)) { if (!empty($matches[$index])) { if ('stable' === $matches[$index]) { return $version; } $version .= '-' . $this->expandStability($matches[$index]) . (!empty($matches[$index+1]) ? $matches[$index+1] : ''); } if (!empty($matches[$index+2])) { $version .= '-dev'; } return $version; } // match dev branches if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) { try { return $this->normalizeBranch($match[1]); } catch (\Exception $e) { } } $extraMessage = ''; if (preg_match('{ +as +'.preg_quote($version).'$}', $fullVersion)) { $extraMessage = ' in "'.$fullVersion.'", the alias must be an exact version'; } elseif (preg_match('{^'.preg_quote($version).' +as +}', $fullVersion)) { $extraMessage = ' in "'.$fullVersion.'", the alias source must be an exact version, if it is a branch name you should prefix it with dev-'; } throw new \UnexpectedValueException('Invalid version string "'.$version.'"'.$extraMessage);

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.0150.00616.88
8.3.50.0110.00921.31
8.3.40.0090.00619.10
8.3.30.0070.00719.17
8.3.20.0050.00320.30
8.3.10.0000.00823.65
8.3.00.0000.00819.80
8.2.180.0150.00317.25
8.2.170.0080.00819.04
8.2.160.0120.00322.96
8.2.150.0060.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00822.34
8.2.110.0030.00722.08
8.2.100.0080.00419.27
8.2.90.0040.00418.13
8.2.80.0030.00619.73
8.2.70.0030.00518.05
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0080.00022.45
8.2.30.0050.00318.28
8.2.20.0000.00817.91
8.2.10.0020.00518.31
8.2.00.0040.00418.21
8.1.280.0060.00925.92
8.1.270.0000.00824.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00422.18
8.1.230.0090.00518.96
8.1.220.0070.00318.04
8.1.210.0000.00818.77
8.1.200.0030.00617.50
8.1.190.0040.00417.60
8.1.180.0030.00618.10
8.1.170.0000.00918.90
8.1.160.0050.00222.08
8.1.150.0040.00418.91
8.1.140.0050.00317.73
8.1.130.0000.00718.00
8.1.120.0030.00917.74
8.1.110.0000.00817.64
8.1.100.0050.00317.67
8.1.90.0050.00317.70
8.1.80.0040.00417.71
8.1.70.0030.00317.71
8.1.60.0040.00417.64
8.1.50.0030.00617.78
8.1.40.0000.00817.77
8.1.30.0000.00917.85
8.1.20.0040.00417.85
8.1.10.0000.00917.68
8.1.00.0030.00817.74
8.0.300.0050.00219.98
8.0.290.0050.00317.00
8.0.280.0000.00718.61
8.0.270.0030.00517.36
8.0.260.0060.00317.36
8.0.250.0070.00017.26
8.0.240.0030.00517.29
8.0.230.0040.00417.28
8.0.220.0020.00517.23
8.0.210.0030.00317.23
8.0.200.0030.00317.25
8.0.190.0030.00517.28
8.0.180.0080.00017.26
8.0.170.0000.00917.22
8.0.160.0000.00817.21
8.0.150.0030.00517.07
8.0.140.0040.00417.08
8.0.130.0000.00613.67
8.0.120.0000.00817.11
8.0.110.0000.00817.29
8.0.100.0040.00417.15
8.0.90.0040.00417.36
8.0.80.0060.00917.24
8.0.70.0000.00717.13
8.0.60.0040.00417.23
8.0.50.0000.00817.19
8.0.30.0120.00817.47
8.0.20.0110.00917.48
8.0.10.0000.00817.14
8.0.00.0100.00817.02
7.4.330.0000.00515.03
7.4.320.0070.00016.91
7.4.300.0030.00317.00
7.4.290.0040.00416.77
7.4.280.0000.00816.98
7.4.270.0040.00416.98
7.4.260.0030.00516.87
7.4.250.0040.00416.73
7.4.240.0000.00716.87
7.4.230.0070.00016.72
7.4.220.0130.00716.82
7.4.210.0000.01516.96
7.4.200.0040.00417.07
7.4.160.0140.00717.10
7.4.150.0060.01317.40
7.4.140.0090.01517.86
7.4.130.0080.01216.75
7.4.120.0100.00816.89
7.4.110.0130.00516.75
7.4.100.0090.01216.77
7.4.90.0060.01116.71
7.4.80.0030.01419.39
7.4.70.0110.00716.90
7.4.60.0150.00316.84
7.4.50.0000.00916.78
7.4.40.0180.00616.70
7.4.30.0090.00916.74
7.4.00.0090.00915.37
7.3.330.0070.00013.53
7.3.320.0050.00013.34
7.3.310.0040.00416.69
7.3.300.0000.00716.64
7.3.290.0060.01016.67
7.3.280.0050.01516.65
7.3.270.0070.01717.40
7.3.260.0180.00016.51
7.3.250.0130.00916.56
7.3.240.0060.01216.65
7.3.230.0120.00816.81
7.3.210.0070.01017.02
7.3.200.0120.00916.63
7.3.190.0070.01016.81
7.3.180.0070.01016.73
7.3.170.0110.01116.66
7.3.160.0080.00816.73
7.3.120.0080.00815.15
7.3.110.0060.01115.20
7.3.100.0060.00814.90
7.3.90.0060.00815.15
7.3.80.0060.00515.11
7.3.70.0040.00914.98
7.3.60.0020.00915.14
7.3.50.0060.00714.95
7.3.40.0040.00814.92
7.3.30.0050.01215.06
7.3.20.0040.00916.86
7.3.10.0070.00616.96
7.3.00.0070.00716.94
7.2.330.0090.00916.88
7.2.320.0030.01416.84
7.2.310.0160.00617.06
7.2.300.0070.01116.84
7.2.290.0090.01516.86
7.2.250.0030.01514.98
7.2.240.0100.00915.29
7.2.230.0070.00815.26
7.2.220.0040.01115.34
7.2.210.0030.01215.18
7.2.200.0070.00815.21
7.2.190.0070.00515.31
7.2.180.0010.01215.18
7.2.170.0040.00515.29
7.2.160.0050.01015.21
7.2.150.0070.00817.27
7.2.140.0040.00917.13
7.2.130.0060.00817.01
7.2.120.0050.00817.08
7.2.110.0060.00617.12
7.2.100.0040.01217.05
7.2.90.0040.01117.20
7.2.80.0040.00617.21
7.2.70.0110.00416.99
7.2.60.0080.00517.17
7.2.50.0080.00617.10
7.2.40.0020.01117.19
7.2.30.0080.00517.20
7.2.20.0060.00917.20
7.2.10.0100.00317.04
7.2.00.0040.00817.66
7.1.330.0060.01015.96
7.1.320.0030.00915.82
7.1.310.0040.00816.09
7.1.300.0060.00615.96
7.1.290.0050.00615.90
7.1.280.0070.00716.13
7.1.270.0100.00615.97
7.1.260.0070.00516.05
7.1.250.0040.00916.04
7.1.200.0000.01216.05
7.1.70.0000.01817.31
7.1.60.0060.00617.63
7.1.50.0220.01234.65
7.1.00.0030.07722.42
7.0.200.0040.01117.00
7.0.60.0100.08020.07
7.0.50.0000.04317.99
7.0.40.0000.05019.93
7.0.30.0200.04720.16
7.0.20.0300.07020.20
7.0.10.0070.05320.11
7.0.00.0130.07720.13
5.6.280.0030.07320.92
5.6.210.0070.07020.62
5.6.200.0070.07718.22
5.6.190.0170.04720.34
5.6.180.0500.07720.57
5.6.170.0200.04020.47
5.6.160.0000.04720.44
5.6.150.0100.03718.18
5.6.140.0100.05318.15
5.6.130.0100.04018.16
5.6.120.0000.06021.00
5.6.110.0070.07021.13
5.6.100.0100.08320.99
5.6.90.0030.06020.98
5.6.80.0130.07320.54
5.5.350.0370.06320.42
5.5.340.0130.08018.01
5.5.330.0030.09020.56
5.5.320.0000.09020.21
5.5.310.0170.05020.41
5.5.300.0100.07717.93
5.5.290.0000.07018.02
5.5.280.0070.08320.87
5.5.270.0100.08320.98
5.5.260.0130.06020.89
5.5.250.0100.08020.63
5.5.240.0000.08020.14
5.4.450.0670.07719.59
5.4.440.0100.08019.46
5.4.430.0070.05719.34
5.4.420.0070.06019.39
5.4.410.0100.05319.43
5.4.400.0100.06019.13
5.4.390.0000.07319.08
5.4.380.0200.04719.08
5.4.370.0170.06719.07
5.4.360.0070.05719.08
5.4.350.0130.05319.05
5.4.340.0000.06319.03
5.4.320.0170.06019.04
5.4.310.0030.06019.14
5.4.300.0230.04019.12
5.4.290.0030.06019.04
5.4.280.0200.06719.23
5.4.270.0200.05319.13
5.4.260.0170.07719.08
5.4.250.0100.06719.05
5.4.240.0130.05019.11
5.4.230.0100.05319.05
5.4.220.0100.07719.15
5.4.210.0170.05319.19
5.4.200.0200.05716.80
5.4.190.0170.05319.00
5.4.180.0100.07319.20
5.4.170.0130.06318.96
5.4.160.0170.04718.99
5.4.150.0030.06019.01
5.4.140.0170.05016.53
5.4.130.0070.05316.39
5.4.120.0100.05016.39
5.4.110.0130.04716.45
5.4.100.0170.05316.71
5.4.90.0100.07016.52
5.4.80.0070.06716.51
5.4.70.0070.07716.39
5.4.60.0030.07016.57
5.4.50.0170.04716.26
5.4.40.0230.06016.45
5.4.30.0170.06016.23
5.4.20.0100.06016.26
5.4.10.0030.05316.23
5.4.00.0130.04715.89
5.3.290.0030.06014.65
5.3.280.0130.04714.66
5.3.270.0070.05714.64
5.3.260.0200.04714.59
5.3.250.0100.06314.57
5.3.240.0030.06014.73
5.3.230.0200.05714.71
5.3.220.0170.05714.55
5.3.210.0070.05714.53
5.3.200.0100.06014.66
5.3.190.0030.07314.52
5.3.180.0070.05314.66
5.3.170.0070.05314.72
5.3.160.0030.06014.78
5.3.150.0000.06314.57
5.3.140.0100.04714.63
5.3.130.0130.05014.50
5.3.120.0070.05714.58
5.3.110.0130.05014.65
5.3.100.0100.04714.21
5.3.90.0130.04314.13
5.3.80.0000.05714.09
5.3.70.0070.05314.27
5.3.60.0170.05014.01
5.3.50.0100.04713.89
5.3.40.0030.05313.93
5.3.30.0100.04713.93
5.3.20.0070.05013.79
5.3.10.0030.05313.65
5.3.00.0000.05713.84
5.2.170.0070.05011.14
5.2.160.0030.04311.14
5.2.150.0130.03711.17
5.2.140.0000.05011.18
5.2.130.0070.04311.16
5.2.120.0200.04311.16
5.2.110.0130.03311.17
5.2.100.0070.04711.18
5.2.90.0130.04011.12
5.2.80.0030.04311.35
5.2.70.0170.04711.09
5.2.60.0130.04711.05
5.2.50.0170.04711.02
5.2.40.0030.04310.95
5.2.30.0130.04711.05
5.2.20.0100.03711.00
5.2.10.0000.04311.09
5.2.00.0030.04310.96
5.1.60.0070.0339.93
5.1.50.0000.0379.97
5.1.40.0030.03710.17
5.1.30.0000.04010.57
5.1.20.0100.03310.60
5.1.10.0030.04010.00
5.1.00.0030.03710.14
5.0.50.0070.0278.73
5.0.40.0030.0378.44
5.0.30.0070.0438.25
5.0.20.0000.0308.28
5.0.10.0070.0238.19
5.0.00.0070.0408.42
4.4.90.0030.0275.80
4.4.80.0000.0235.75
4.4.70.0030.0205.83
4.4.60.0000.0275.88
4.4.50.0100.0175.81
4.4.40.0100.0275.93
4.4.30.0030.0205.79
4.4.20.0030.0235.86
4.4.10.0070.0205.96
4.4.00.0100.0275.82
4.3.110.0030.0235.71
4.3.100.0000.0235.80
4.3.90.0030.0235.68
4.3.80.0070.0375.76
4.3.70.0030.0235.86
4.3.60.0070.0235.67
4.3.50.0070.0275.79
4.3.40.0000.0375.77
4.3.30.0030.0204.48
4.3.20.0000.0304.43
4.3.10.0000.0234.52
4.3.00.0130.0207.02

preferences:
63.44 ms | 401 KiB | 5 Q