3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = new ReflectionClass(A::class); extractMethodBody($re->getMethod('a')); /** * @param \ReflectionMethod $method * @return string */ function extractMethodBody(\ReflectionMethod $method) { $startLine = $method->getStartLine(); $endLine = $method->getEndLine() + 1; $resource = fopen($method->getFileName(), 'r'); $currentLine = 0; while (!feof($resource) && ++$currentLine < $startLine) { fgets($resource, 1024); } $buffer = ''; while (!feof($resource) && ++$currentLine <= $endLine) { $buffer .= fgets($resource, 1024); } preg_match(sprintf('/(?:public|protected|private|final|abstract|static)*?' . '\s+function\s+%s\([^\)]*\)\s*(?:\{(?:[^{}]*|(?R))*\})/sm', preg_quote($method->getName())), $buffer, $matches ); return $matches[0]; } class A { public function test(stdClass $b) { return $b; } }

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.0140.00418.56
8.3.50.0130.00522.05
8.3.40.0090.00618.97
8.3.30.0070.00719.09
8.3.20.0000.00720.16
8.3.10.0030.00521.94
8.3.00.0050.00319.17
8.2.180.0130.00318.29
8.2.170.0130.00322.96
8.2.160.0030.01220.49
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00319.77
8.2.110.0060.00321.18
8.2.100.0060.00617.72
8.2.90.0050.00317.63
8.2.80.0030.00517.97
8.2.70.0060.00317.80
8.2.60.0040.00418.16
8.2.50.0040.00418.10
8.2.40.0070.00019.23
8.2.30.0050.00320.70
8.2.20.0050.00217.70
8.2.10.0040.00417.88
8.2.00.0020.00517.73
8.1.280.0130.00725.92
8.1.270.0080.00018.52
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00617.66
8.1.230.0040.00717.83
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00717.36
8.1.190.0000.00817.23
8.1.180.0000.01118.10
8.1.170.0060.00318.46
8.1.160.0030.00618.89
8.1.150.0000.00718.84
8.1.140.0000.00717.45
8.1.130.0000.00717.84
8.1.120.0070.00017.45
8.1.110.0000.00717.30
8.1.100.0020.00517.37
8.1.90.0070.00017.34
8.1.80.0080.00017.46
8.1.70.0030.00317.38
8.1.60.0040.00417.55
8.1.50.0000.00817.59
8.1.40.0040.00417.55
8.1.30.0000.00817.63
8.1.20.0000.00817.68
8.1.10.0070.00017.65
8.1.00.0050.00317.38
8.0.300.0000.00918.77
8.0.290.0040.00416.62
8.0.280.0000.00818.46
8.0.270.0030.00317.32
8.0.260.0000.00617.15
8.0.250.0030.00316.87
8.0.240.0030.00316.86
8.0.230.0030.00317.01
8.0.220.0000.00716.88
8.0.210.0000.00716.90
8.0.200.0030.00316.86
8.0.190.0040.00416.94
8.0.180.0000.00816.88
8.0.170.0080.00016.92
8.0.160.0040.00416.88
8.0.150.0090.00016.73
8.0.140.0050.00216.73
8.0.130.0030.00313.39
8.0.120.0040.00416.83
8.0.110.0040.00416.92
8.0.100.0070.00016.99
8.0.90.0090.00016.82
8.0.80.0030.01216.85
8.0.70.0050.00316.94
8.0.60.0000.00716.92
8.0.50.0000.00716.88
8.0.30.0130.00716.78
8.0.20.0090.01017.40
8.0.10.0080.00016.90
8.0.00.0060.01116.84
7.4.330.0000.00515.21
7.4.320.0000.00616.48
7.4.300.0030.00316.47
7.4.290.0070.00016.53
7.4.280.0080.00016.63
7.4.270.0060.00016.39
7.4.260.0040.00416.59
7.4.250.0000.00716.46
7.4.240.0020.00516.49
7.4.230.0040.00416.44
7.4.220.0130.01016.52
7.4.210.0160.00316.50
7.4.200.0000.00716.57
7.4.160.0110.00416.60
7.4.150.0170.00717.40
7.4.140.0120.00617.86
7.4.130.0110.00716.42
7.4.120.0130.00616.60
7.4.110.0100.01016.41
7.4.100.0120.01216.50
7.4.90.0140.00316.43
7.4.80.0070.01019.39
7.4.70.0100.00716.64
7.4.60.0130.00316.55
7.4.50.0040.00416.57
7.4.40.0190.00316.49
7.4.30.0080.00816.59
7.4.00.0050.01315.01
7.3.330.0000.00513.27
7.3.320.0020.00213.15
7.3.310.0030.00316.21
7.3.300.0080.00016.37
7.3.290.0070.01016.29
7.3.280.0050.01116.31
7.3.270.0110.01117.40
7.3.260.0140.00316.45
7.3.250.0080.00816.49
7.3.240.0060.01016.26
7.3.230.0030.01216.58
7.3.210.0070.01016.25
7.3.200.0040.01219.39
7.3.190.0130.00316.35
7.3.180.0060.00916.56
7.3.170.0130.00316.32
7.3.160.0060.00916.36
7.3.120.0080.00414.68
7.3.110.0030.01414.80
7.3.100.0040.01114.70
7.3.90.0090.00614.79
7.3.80.0000.01414.86
7.3.70.0060.00814.84
7.3.60.0130.00314.69
7.3.50.0110.00014.57
7.3.40.0000.01314.87
7.3.30.0090.00614.68
7.3.20.0070.01016.64
7.3.10.0100.00316.50
7.3.00.0030.01416.68
7.2.330.0100.00716.67
7.2.320.0070.01416.34
7.2.310.0140.01016.57
7.2.300.0030.01416.65
7.2.290.0030.01316.30
7.2.250.0100.00715.17
7.2.240.0130.00615.09
7.2.230.0000.01315.06
7.2.220.0110.00614.95
7.2.210.0090.00615.09
7.2.200.0110.00014.91
7.2.190.0080.00815.01
7.2.180.0060.00814.91
7.2.170.0040.01215.06
7.2.60.0200.00716.43
7.2.00.0120.00919.25
7.1.330.0030.01015.30
7.1.320.0000.01415.55
7.1.310.0060.00915.70
7.1.300.0070.01115.62
7.1.290.0040.00815.38
7.1.280.0070.00715.38
7.1.270.0040.00815.71
7.1.260.0000.01615.64
7.1.200.0090.00915.42
7.1.100.0300.00417.71
7.1.70.0000.00816.97
7.1.60.0040.01519.57
7.1.50.0140.01016.92
7.1.00.0130.06722.44
7.0.200.0080.01216.75
7.0.140.0030.07322.09
7.0.60.0130.04019.96
7.0.50.0030.07717.95
7.0.40.0070.08720.40
7.0.30.0170.04020.12
7.0.20.0230.04020.25
7.0.10.0100.05720.12
7.0.00.0070.08320.06
5.6.280.0030.07320.87
5.6.210.0070.08020.55
5.6.200.0130.06718.20
5.6.190.0030.04720.52
5.6.180.0370.07320.60
5.6.170.0270.09020.48
5.6.160.0030.08720.57
5.6.150.0030.08718.14
5.6.140.0130.07318.23
5.6.130.0000.05718.16
5.6.120.0030.04321.00
5.6.110.0030.08721.05
5.6.100.0070.04320.98
5.6.90.0030.04020.98
5.6.80.0030.07720.39
5.5.350.0000.04320.45
5.5.340.0030.06018.02
5.5.330.0100.04020.39
5.5.320.0330.05020.27
5.5.310.0270.02720.26
5.5.300.0030.08317.98
5.5.290.0000.07317.97
5.5.280.0070.08020.64
5.5.270.0000.04720.98
5.5.260.0070.09020.77
5.5.250.0030.04020.63
5.5.240.0330.07020.20
5.4.450.0630.05019.39
5.4.440.0770.05719.55
5.4.430.0900.06719.16
5.4.420.0030.06019.70
5.4.410.0630.06019.35
5.4.400.0930.03719.15
5.4.390.0830.07319.01
5.4.380.0370.05018.66
5.4.370.0230.05318.61
5.4.360.0230.05018.53
5.4.350.0200.05718.62
5.4.340.0270.05018.56
5.4.320.0270.05018.76
5.4.310.0170.06018.69
5.4.300.0270.05018.77
5.4.290.0230.05018.80
5.4.280.0270.04718.82
5.4.270.0170.05318.55
5.4.260.0170.06018.71
5.4.250.0230.05018.56
5.4.240.0230.05318.78
5.4.230.0230.05018.49
5.4.220.0230.05018.63
5.4.210.0170.05718.79
5.4.200.0300.04316.62
5.4.190.0230.05318.60
5.4.180.0170.05718.60
5.4.170.0170.05318.72
5.4.160.0230.05318.50
5.4.150.0170.05718.50
5.4.140.0230.05016.45
5.4.130.0200.05016.17
5.4.120.0170.05016.29
5.4.110.0170.05316.25
5.4.100.0230.05016.20
5.4.90.0300.04316.32
5.4.80.0370.03716.23
5.4.70.0230.04716.23
5.4.60.0170.05316.13
5.4.50.0200.05016.20
5.4.40.0170.05716.20
5.4.30.0330.04016.15
5.4.20.0230.06016.25
5.4.10.0230.04716.25
5.4.00.0270.04315.71
5.3.290.0170.06014.71
5.3.280.0170.05714.63
5.3.270.0130.06314.66
5.3.260.0270.04714.70
5.3.250.0330.04014.57
5.3.240.0300.05314.64
5.3.230.0170.05314.51
5.3.220.0170.05714.64
5.3.210.0200.05314.56
5.3.200.0300.04314.55
5.3.190.0230.05314.55
5.3.180.0270.04714.57
5.3.170.0170.05314.52
5.3.160.0200.05014.68
5.3.150.0230.04714.53
5.3.140.0430.03014.66
5.3.130.0270.05714.53
5.3.120.0300.05014.53
5.3.110.0270.04714.48
5.3.100.0330.04014.00
5.3.90.0230.04713.97
5.3.80.0200.05013.94
5.3.70.0270.04313.99
5.3.60.0230.04713.98
5.3.50.0230.04713.91
5.3.40.0230.05313.94
5.3.30.0300.04313.94
5.3.20.0130.05713.66
5.3.10.0130.05713.66
5.3.00.0170.05313.62
5.2.170.0130.04711.07
5.2.160.0270.03011.11
5.2.150.0100.05011.14
5.2.140.0170.04311.20
5.2.130.0300.02711.02
5.2.120.0170.04011.13
5.2.110.0130.04011.02
5.2.100.0170.03711.09
5.2.90.0130.05311.15
5.2.80.0130.04711.15
5.2.70.0170.04011.06
5.2.60.0170.04311.00
5.2.50.0270.03011.07
5.2.40.0170.03710.92
5.2.30.0100.04710.88
5.2.20.0230.03011.00
5.2.10.0170.03711.00
5.2.00.0030.05010.73
5.1.60.0100.03710.00
5.1.50.0130.03310.02
5.1.40.0170.0339.96
5.1.30.0100.04010.29
5.1.20.0100.04010.45
5.1.10.0100.03710.12
5.1.00.0100.04010.05
5.0.50.0130.0238.52
5.0.40.0030.0338.38
5.0.30.0070.0438.24
5.0.20.0100.0278.19
5.0.10.0070.0338.28
5.0.00.0070.0438.17
4.4.90.0030.0235.91
4.4.80.0100.0205.86
4.4.70.0030.0235.88
4.4.60.0100.0175.86
4.4.50.0130.0175.91
4.4.40.0030.0375.89
4.4.30.0100.0205.88
4.4.20.0070.0205.96
4.4.10.0030.0236.00
4.4.00.0070.0335.90
4.3.110.0030.0275.80
4.3.100.0030.0235.87
4.3.90.0130.0205.78
4.3.80.0100.0305.80
4.3.70.0030.0275.78
4.3.60.0070.0205.79
4.3.50.0070.0205.77
4.3.40.0070.0335.85
4.3.30.0000.0274.78
4.3.20.0100.0174.78
4.3.10.0000.0234.78
4.3.00.0130.0237.44

preferences:
58.81 ms | 401 KiB | 5 Q