3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); class Test { private function parseDocComment(string $comment): array { $result = []; foreach (\preg_split('#[\r\n]+#', $comment, -1, \PREG_SPLIT_NO_EMPTY) as $line) { if (\preg_match('#\s\*\s*@([a-z0-9\-_])\s*(.*)#i', $line, $match)) { $result[$match[1]] = $match[2] ?? ''; } } return $result; } public function __call(string $name, array $arguments) { $objectReflection = new \ReflectionObject($this); if (!$objectReflection->hasMethod($name)) { throw new Exception('Invalid route target: ' . self::class . '::' . $name); } $methodReflection = $objectReflection->getMethod($name); if (false === $comment = $methodReflection->getDocComment()) { throw new Exception('Invalid route target: ' . self::class . '::' . $name); } $comment = $this->parseDocComment($comment); if (!isset($comment['json'])) { throw new Exception('Invalid route target: ' . self::class . '::' . $name); } return $this->{$name}(...$arguments); } /** * @json */ private function method() { echo ":-("; } } (new Test)->method();

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.0100.01018.68
8.3.50.0150.00316.55
8.3.40.0120.00319.05
8.3.30.0120.00319.10
8.3.20.0080.00019.07
8.3.10.0080.00021.66
8.3.00.0080.00320.04
8.2.180.0200.00018.79
8.2.170.0110.00422.96
8.2.160.0100.01020.38
8.2.150.0060.00324.18
8.2.140.0040.01124.66
8.2.130.0040.00420.35
8.2.120.0040.00426.35
8.2.110.0070.00322.38
8.2.100.0060.00618.09
8.2.90.0000.00819.34
8.2.80.0040.00418.03
8.2.70.0030.00617.75
8.2.60.0030.00617.80
8.2.50.0030.00618.10
8.2.40.0040.00420.45
8.2.30.0040.00421.25
8.2.20.0060.00318.28
8.2.10.0040.00418.27
8.2.00.0040.00418.20
8.1.280.0150.00425.92
8.1.270.0040.00421.91
8.1.260.0050.00326.35
8.1.250.0000.00828.09
8.1.240.0030.00624.00
8.1.230.0080.00322.16
8.1.220.0000.00817.75
8.1.210.0000.00818.77
8.1.200.0030.00717.47
8.1.190.0030.00617.48
8.1.180.0000.00818.10
8.1.170.0000.00818.71
8.1.160.0040.00419.06
8.1.150.0040.00419.00
8.1.140.0030.00619.67
8.1.130.0000.00718.92
8.1.120.0000.00717.65
8.1.110.0000.00717.66
8.1.100.0040.00417.51
8.1.90.0040.00417.63
8.1.80.0040.00417.64
8.1.70.0050.00317.58
8.1.60.0040.00417.75
8.1.50.0040.00417.68
8.1.40.0040.00417.58
8.1.30.0000.00817.71
8.1.20.0000.01017.74
8.1.10.0030.00617.71
8.1.00.0040.00417.65
8.0.300.0090.00018.77
8.0.290.0040.00416.75
8.0.280.0070.00018.47
8.0.270.0030.00317.29
8.0.260.0000.00817.04
8.0.250.0030.00317.22
8.0.240.0030.00517.06
8.0.230.0000.00717.05
8.0.220.0070.00017.18
8.0.210.0070.00017.07
8.0.200.0040.00417.21
8.0.190.0050.00317.19
8.0.180.0090.00017.15
8.0.170.0070.00017.03
8.0.160.0050.00317.01
8.0.150.0080.00017.06
8.0.140.0040.00417.07
8.0.130.0000.00613.50
8.0.120.0050.00217.14
8.0.110.0030.00317.12
8.0.100.0000.00817.19
8.0.90.0050.00317.01
8.0.80.0120.00617.14
8.0.70.0000.00717.03
8.0.60.0000.00817.18
8.0.50.0040.00417.09
8.0.30.0080.01017.34
8.0.20.0100.00817.48
8.0.10.0070.00017.11
8.0.00.0070.01016.91
7.4.330.0020.00215.55
7.4.320.0000.00616.70
7.4.300.0000.00816.73
7.4.290.0050.00516.87
7.4.280.0050.00216.69
7.4.270.0040.00416.92
7.4.260.0080.00013.54
7.4.250.0030.00316.73
7.4.240.0050.00316.84
7.4.230.0040.00416.77
7.4.220.0130.01316.68
7.4.210.0090.00616.92
7.4.200.0000.00716.91
7.4.160.0060.01116.78
7.4.150.0130.00417.40
7.4.140.0090.00917.86
7.4.130.0090.01216.57
7.4.120.0100.01016.81
7.4.110.0070.01016.75
7.4.100.0100.01416.85
7.4.90.0150.00316.61
7.4.80.0100.00719.39
7.4.70.0030.01316.79
7.4.60.0110.01116.84
7.4.50.0030.01216.58
7.4.40.0130.01016.64
7.4.30.0090.00816.58
7.4.00.0070.01015.29
7.3.330.0000.00713.57
7.3.320.0050.00013.64
7.3.310.0040.00416.56
7.3.300.0030.00316.46
7.3.290.0090.00716.57
7.3.280.0080.00916.57
7.3.270.0180.00017.40
7.3.260.0080.00916.63
7.3.250.0130.00616.79
7.3.240.0100.00716.60
7.3.230.0090.00916.54
7.3.210.0110.00816.61
7.3.200.0130.00416.71
7.3.190.0060.01016.66
7.3.180.0070.01016.44
7.3.170.0090.00916.74
7.3.160.0080.00716.83
7.3.10.0250.00616.78
7.3.00.0060.01316.39
7.2.330.0090.00917.04
7.2.320.0040.01716.76
7.2.310.0100.00716.80
7.2.300.0110.01116.80
7.2.290.0040.01716.93
7.2.130.0120.00816.83
7.2.120.0220.00717.07
7.2.110.0290.01316.61
7.2.100.0140.00916.73
7.2.90.0100.00716.98
7.2.80.0170.00611.90
7.2.70.0060.00916.82
7.2.60.0160.00516.94
7.2.50.0080.00317.09
7.2.40.0090.00916.87
7.2.30.0180.01116.95
7.2.20.0030.01316.96
7.2.10.0120.00716.57
7.2.00.0070.01417.14
7.1.250.0170.00715.87
7.1.200.0000.01215.85
7.1.100.0040.00418.26
7.1.70.0000.00817.13
7.1.60.0900.01333.64
7.1.50.0730.01732.93
7.1.40.0770.02332.75
7.1.30.0800.01733.04
7.1.20.0930.01332.74
7.1.10.0770.01314.79
7.1.00.0600.02015.16
7.0.200.0530.01315.05
7.0.190.3400.01015.17
7.0.180.0700.02014.67
7.0.170.0670.01314.70
7.0.160.0730.01314.42
7.0.150.0630.02014.65
7.0.140.0830.01314.97
7.0.130.0770.01714.99
7.0.120.0700.00714.66
7.0.110.0730.01314.75
7.0.100.0070.01714.81
7.0.90.1000.00714.63
7.0.80.0800.01014.58
7.0.70.0730.01314.53
7.0.60.0770.01314.70
7.0.50.0900.01014.69
7.0.40.0170.01714.79
7.0.30.0570.01314.85
7.0.20.0070.02014.73
7.0.10.0700.01314.89
7.0.00.0700.01014.78

preferences:
37.11 ms | 400 KiB | 5 Q