3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class Status { private static $codeMap = [ 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-status', 208 => 'Already Reported', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Time-out', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Large', 415 => 'Unsupported Media Type', 416 => 'Requested range not satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 425 => 'Unordered Collection', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Time-out', 505 => 'HTTP Version not supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected', 511 => 'Network Authentication Required', ]; /** @var self[] */ private static $instances = []; /** @var int */ private $code; /** @var string */ private $reason; /** * @param int $aCode * @throws InvalidArgumentException on invalid code */ private function __construct($aCode) { if (!array_key_exists((int) $aCode, static::$codeMap)) { throw new InvalidArgumentExeption("Invalid status code: [$aCode]"); } $this->code = (int) $aCode; $this->reason = static::$codeMap[$this->code]; } /** * @example $status = Status::404(); * @return self */ public static function __callStatic($aMethod, array $arguments) { $aMethod = trim($aMethod, '_'); if (!array_key_exists($aMethod, static::$instances)) { static::$instances[$aMethod] = new static($aMethod); } return static::$instances[$aMethod]; } /** @return bool */ public function hasCode($aCode) { return $this->code === (int) $aCode; } /** @return string */ public function __toString() { return $this->code . ' ' . $this->reason; } } var_dump(Status::_200());

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.00016.63
8.3.50.0070.01018.12
8.3.40.0140.00718.76
8.3.30.0120.00919.22
8.3.20.0080.01120.21
8.3.10.0040.00421.79
8.3.00.0080.00019.51
8.2.180.0040.01118.29
8.2.170.0160.00322.96
8.2.160.0130.00420.43
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.36
8.2.110.0030.00620.39
8.2.100.0120.00017.72
8.2.90.0040.00418.06
8.2.80.0050.00317.97
8.2.70.0040.00417.63
8.2.60.0120.00018.05
8.2.50.0060.00318.07
8.2.40.0050.00319.92
8.2.30.0040.00418.14
8.2.20.0030.00617.82
8.2.10.0030.00618.15
8.2.00.0060.00317.72
8.1.280.0100.00325.92
8.1.270.0030.00718.95
8.1.260.0090.00026.35
8.1.250.0000.00828.09
8.1.240.0060.00322.20
8.1.230.0060.00620.96
8.1.220.0000.00817.79
8.1.210.0000.00819.03
8.1.200.0040.00817.23
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0040.00420.38
8.1.160.0040.00422.06
8.1.150.0040.00418.96
8.1.140.0000.00717.48
8.1.130.0040.00417.84
8.1.120.0110.00017.51
8.1.110.0080.00017.42
8.1.100.0080.00017.38
8.1.90.0070.00017.52
8.1.80.0000.00717.38
8.1.70.0050.00317.38
8.1.60.0030.00617.70
8.1.50.0040.00417.52
8.1.40.0050.00317.53
8.1.30.0000.00817.70
8.1.20.0050.00317.62
8.1.10.0040.00417.54
8.1.00.0000.00717.57
8.0.300.0000.00820.16
8.0.290.0080.00016.75
8.0.280.0000.00718.48
8.0.270.0040.00417.29
8.0.260.0050.00317.29
8.0.250.0030.00316.87
8.0.240.0060.00317.01
8.0.230.0030.00316.96
8.0.220.0030.00316.97
8.0.210.0040.00416.89
8.0.200.0000.00816.93
8.0.190.0000.00816.88
8.0.180.0000.00716.84
8.0.170.0080.00016.85
8.0.160.0040.00417.00
8.0.150.0050.00216.89
8.0.140.0050.00216.79
8.0.130.0060.00013.35
8.0.120.0040.00416.89
8.0.110.0080.00016.84
8.0.100.0040.00416.93
8.0.90.0000.00816.79
8.0.80.0030.01316.99
8.0.70.0040.00416.88
8.0.60.0030.00516.92
8.0.50.0000.00716.77
8.0.30.0140.00917.07
8.0.20.0100.00917.40
8.0.10.0070.00017.11
8.0.00.0100.00816.74
7.4.330.0000.00515.05
7.4.320.0030.00316.54
7.4.300.0040.00416.66
7.4.290.0000.00816.63
7.4.280.0000.00816.41
7.4.270.0030.00316.54
7.4.260.0030.00616.51
7.4.250.0040.00416.58
7.4.240.0040.00416.58
7.4.230.0000.00716.72
7.4.220.0060.01616.57
7.4.210.0120.00916.61
7.4.200.0000.00716.64
7.4.160.0150.00316.51
7.4.150.0160.00917.40
7.4.140.0100.00717.86
7.4.130.0120.00916.56
7.4.120.0100.00716.58
7.4.110.0120.00616.63
7.4.100.0120.00816.48
7.4.90.0170.00416.46
7.4.80.0120.00919.39
7.4.70.0000.01716.27
7.4.60.0060.01016.54
7.4.50.0000.00416.50
7.4.40.0030.01716.48
7.4.30.0110.00616.50
7.4.00.0110.00415.09
7.3.330.0050.00013.20
7.3.320.0090.00513.37
7.3.310.0000.00716.41
7.3.300.0000.00716.35
7.3.290.0030.01016.42
7.3.280.0090.00616.35
7.3.270.0070.01017.40
7.3.260.0150.00316.48
7.3.250.0110.00816.51
7.3.240.0060.01116.55
7.3.230.0140.00316.39
7.3.210.0040.01216.36
7.3.200.0090.00919.39
7.3.190.0090.01216.54
7.3.180.0090.00616.36
7.3.170.0100.01016.53
7.3.160.0140.00616.57
7.2.330.0080.01116.83
7.2.320.0150.00316.87
7.2.310.0070.01016.61
7.2.300.0060.01016.89
7.2.290.0060.01616.64
7.2.60.0000.01016.93
7.2.00.0070.00719.65
7.1.200.0070.00715.77
7.1.100.0160.00617.92
7.1.70.0030.00717.01
7.1.60.0100.01419.50
7.1.50.0060.01616.91
7.1.00.0100.06722.51
7.0.200.0040.00416.76
7.0.140.0100.07022.01
7.0.60.0000.05020.09
7.0.50.0030.04017.89
7.0.40.0100.04020.18
7.0.30.0370.07320.16
7.0.20.0200.04020.12
7.0.10.0200.03720.15
7.0.00.0130.05020.09
5.6.280.0030.07021.10
5.6.210.0100.08020.69
5.6.200.0030.06018.15
5.6.190.0100.08720.39
5.6.180.0230.07320.53
5.6.170.0330.07020.52
5.6.160.0130.03720.56
5.6.150.0000.06018.25
5.6.140.0030.08718.17
5.6.130.0070.08718.14
5.6.120.0070.05721.06
5.6.110.0200.06021.16
5.6.100.0130.06721.02
5.6.90.0100.04721.03
5.6.80.0070.08020.40
5.6.70.0200.07320.29
5.5.350.0200.07320.45
5.5.340.0030.08317.97
5.5.330.0030.06020.41
5.5.320.0130.07720.32
5.5.310.0070.04720.34
5.5.300.0030.08318.01
5.5.290.0070.03718.02
5.5.280.0030.08321.00
5.5.270.0070.04720.76
5.5.260.0100.07720.74
5.5.250.0130.06320.57
5.5.240.0030.08320.38
5.4.450.0800.05319.34
5.4.440.0930.07319.55
5.4.430.0930.05319.33
5.4.420.0400.05319.54
5.4.410.1030.06019.25
5.4.400.0130.05718.75
5.4.390.0470.06018.76
5.4.380.0130.05718.73
5.4.370.0130.05718.63
5.4.360.0430.05018.79
5.4.350.0170.05318.63
5.4.340.0470.05718.80
5.4.320.0170.05318.59
5.4.310.0500.04718.85
5.4.300.0170.06018.61
5.4.290.0470.05018.79
5.4.280.0170.05018.79
5.4.270.0100.06318.62
5.4.260.0470.04718.58
5.4.250.0100.06718.77
5.4.240.0530.04318.59
5.4.230.0130.05318.50
5.4.220.0170.05718.82
5.4.210.0400.05718.76
5.4.200.0170.04716.63
5.4.190.0430.05318.75
5.4.180.0230.06718.53
5.4.170.0530.06718.53
5.4.160.0170.05718.56
5.4.150.0170.05318.73
5.4.140.0470.06016.32
5.4.130.0270.04016.31
5.4.120.0200.04716.35
5.4.110.0470.04316.30
5.4.100.0070.06016.33
5.4.90.0430.04716.35
5.4.80.0200.04316.16
5.4.70.0400.06016.50
5.4.60.0100.05716.15
5.4.50.0100.05716.43
5.4.40.0530.05016.42
5.4.30.0200.04716.22
5.4.20.0430.05316.26
5.4.10.0100.05316.24
5.4.00.0430.05015.79
5.3.290.0170.05314.76
5.3.280.0270.05714.80
5.3.270.0170.06714.72
5.3.260.0570.05314.63
5.3.250.0070.06014.77
5.3.240.0500.05014.62
5.3.230.0270.05014.71
5.3.220.0430.05314.61
5.3.210.0230.05014.54
5.3.200.0070.06014.76
5.3.190.0500.05014.63
5.3.180.0170.06014.55
5.3.170.0570.04314.68
5.3.160.0230.04014.58
5.3.150.0700.07314.59
5.3.140.0230.04314.75
5.3.130.0500.05314.58
5.3.120.0100.05714.55
5.3.110.0200.05314.76
5.3.100.0530.05314.07
5.3.90.0170.05014.01
5.3.80.0530.05014.01
5.3.70.0100.05314.09
5.3.60.0570.04714.11
5.3.50.0130.05313.91
5.3.40.0470.05714.00
5.3.30.0200.04314.03
5.3.20.0470.05313.74
5.3.10.0200.05013.76
5.3.00.0200.05013.85
5.2.170.0270.03711.18
5.2.160.0500.04311.34
5.2.150.0200.03311.21
5.2.140.0500.04711.24
5.2.130.0130.04011.20
5.2.120.0230.02711.12
5.2.110.0630.04011.20
5.2.100.0100.04311.17
5.2.90.0630.04011.17
5.2.80.0130.04011.14
5.2.70.0170.04011.29
5.2.60.0530.05011.02
5.2.50.0300.04311.12
5.2.40.0600.04011.11
5.2.30.0170.04710.96
5.2.20.0170.03711.14
5.2.10.0570.04311.04
5.2.00.0130.04310.82
5.1.60.0130.0339.97
5.1.50.0070.0379.99
5.1.40.0670.03710.18
5.1.30.0070.04010.36
5.1.20.0100.03710.45
5.1.10.0700.04010.05
5.1.00.0100.03710.09
5.0.50.0070.0308.57
5.0.40.0070.0278.61
5.0.30.0100.0438.40
5.0.20.0030.0308.32
5.0.10.0570.0308.29
5.0.00.0170.0378.24
4.4.90.0070.0305.89
4.4.80.0030.0235.86
4.4.70.0000.0275.84
4.4.60.0130.0205.84
4.4.50.0100.0205.95
4.4.40.0670.0305.88
4.4.30.0070.0205.88
4.4.20.0030.0235.93
4.4.10.0130.0175.96
4.4.00.0070.0375.89
4.3.110.0000.0275.88
4.3.100.0130.0135.79
4.3.90.0000.0305.82
4.3.80.0530.0335.87
4.3.70.0030.0235.80
4.3.60.0070.0205.79
4.3.50.0000.0305.79
4.3.40.0030.0375.80
4.3.30.0030.0234.57
4.3.20.0030.0234.52
4.3.10.0070.0204.52
4.3.00.0130.0206.75

preferences:
46.55 ms | 400 KiB | 5 Q