3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Challenge 3: Use reflection to get access to Question::$answer from $e->getAnswer */ class Question { private $answer = 42; public function __construct($e) { try { throw $e; } catch (Exception $e) { echo $e->getAnswer($this) . PHP_EOL; } } } // start editing here class Answer extends Exception { public function getAnswer($question) { $property = new ReflectionProperty('Question', 'answer'); $property->setAccessible(true); return $property->getValue($question); } } $e = new Answer; // end editing here new Question($e);

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.0110.00316.63
8.3.50.0110.00817.29
8.3.40.0060.00918.79
8.3.30.0110.00418.67
8.3.20.0040.00418.90
8.3.10.0080.00018.85
8.3.00.0040.00419.38
8.2.180.0030.01618.54
8.2.170.0140.00722.96
8.2.160.0110.00420.47
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00420.80
8.2.110.0000.00920.22
8.2.100.0040.00717.69
8.2.90.0000.00819.08
8.2.80.0060.00317.97
8.2.70.0050.00317.75
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0000.00818.16
8.2.30.0020.00917.93
8.2.20.0030.00617.62
8.2.10.0040.00417.70
8.2.00.0040.00417.61
8.1.280.0110.00725.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.19
8.1.230.0080.00417.42
8.1.220.0000.01017.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0000.00817.40
8.1.180.0050.00318.10
8.1.170.0050.00318.71
8.1.160.0070.00018.95
8.1.150.0040.00418.61
8.1.140.0000.00717.38
8.1.130.0000.00717.79
8.1.120.0030.00317.54
8.1.110.0050.00317.50
8.1.100.0000.00717.39
8.1.90.0000.01017.40
8.1.80.0000.00717.49
8.1.70.0070.00017.45
8.1.60.0060.00317.50
8.1.50.0080.00017.46
8.1.40.0090.00017.51
8.1.30.0030.00617.70
8.1.20.0040.00417.59
8.1.10.0030.00617.60
8.1.00.0080.00017.54
8.0.300.0040.00418.77
8.0.290.0020.00516.75
8.0.280.0000.00718.38
8.0.270.0050.00217.31
8.0.260.0070.00016.89
8.0.250.0000.00817.07
8.0.240.0040.00417.06
8.0.230.0030.00517.05
8.0.220.0070.00016.98
8.0.210.0040.00416.88
8.0.200.0070.00016.99
8.0.190.0000.00817.04
8.0.180.0030.00617.00
8.0.170.0060.00317.00
8.0.160.0040.00417.00
8.0.150.0000.01016.81
8.0.140.0030.00516.95
8.0.130.0000.00613.42
8.0.120.0000.00716.82
8.0.110.0020.00516.85
8.0.100.0070.00017.00
8.0.90.0040.00416.80
8.0.80.0100.00716.97
8.0.70.0050.00316.90
8.0.60.0050.00316.91
8.0.50.0000.00817.02
8.0.30.0090.00916.89
8.0.20.0110.00917.09
8.0.10.0040.00416.91
8.0.00.0160.00416.95
7.4.330.0050.00012.98
7.4.320.0030.00316.50
7.4.300.0040.00416.57
7.4.290.0070.00416.62
7.4.280.0040.00416.43
7.4.270.0070.00016.62
7.4.260.0050.00013.35
7.4.250.0000.01016.57
7.4.240.0030.00416.53
7.4.230.0030.00316.51
7.4.220.0120.00616.48
7.4.210.0090.00816.62
7.4.200.0040.00416.69
7.4.190.0040.00416.61
7.4.160.0060.01516.61
7.4.150.0100.00716.62
7.4.140.0080.01016.60
7.4.130.0100.00716.47
7.4.120.0080.00916.63
7.4.110.0090.00916.63
7.4.100.0030.01316.51
7.4.90.0100.01016.46
7.4.80.0120.00619.39
7.4.70.0080.01316.52
7.4.60.0120.00416.49
7.4.50.0050.00816.59
7.4.40.0070.00716.41
7.4.30.0080.00816.65
7.4.00.0040.01215.00
7.3.330.0000.00713.39
7.3.320.0000.00613.18
7.3.310.0030.00316.41
7.3.300.0000.00716.37
7.3.290.0180.00016.33
7.3.280.0100.00816.33
7.3.270.0150.00916.34
7.3.260.0070.01116.33
7.3.250.0080.01116.47
7.3.240.0120.00916.46
7.3.230.0170.00016.55
7.3.210.0080.00816.35
7.3.200.0030.01416.55
7.3.190.0080.00816.34
7.3.180.0090.00616.36
7.3.170.0140.00416.57
7.3.160.0040.01116.43
7.3.120.0000.01414.92
7.3.10.0070.00716.48
7.3.00.0090.00816.59
7.2.330.0120.01316.51
7.2.320.0100.00716.65
7.2.310.0100.01516.68
7.2.300.0030.01316.64
7.2.290.0100.00716.73
7.2.130.0090.00917.06
7.2.120.0090.00616.69
7.2.110.0080.01016.73
7.2.100.0090.00616.77
7.2.90.0100.00916.80
7.2.80.0090.00516.80
7.2.70.0150.00416.81
7.2.60.0130.00216.67
7.2.50.0130.00316.86
7.2.40.0090.00816.87
7.2.30.0090.00916.76
7.2.20.0090.00616.77
7.2.10.0120.00216.63
7.2.00.0080.00717.07
7.1.250.0070.00715.43
7.1.70.0000.00717.21
7.1.60.0040.00717.18
7.1.50.0060.01616.95
7.1.00.0130.06322.40
7.0.200.0070.00716.98
7.0.140.0030.07322.15
7.0.120.0070.06322.04
7.0.60.0100.08019.86
7.0.50.0130.05317.92
7.0.40.0030.08720.13
7.0.30.0300.07720.20
7.0.20.0300.04720.16
7.0.10.0270.07320.30
7.0.00.0100.07720.14
5.6.280.0030.07020.90
5.6.210.0030.04020.49
5.6.200.0070.07718.25
5.6.190.0030.04320.63
5.6.180.0300.07720.58
5.6.170.0200.04720.51
5.6.160.0100.08320.46
5.6.150.0100.05018.27
5.6.140.0030.07018.23
5.6.130.0030.08018.23
5.6.120.0030.09021.02
5.6.110.0130.06021.12
5.6.100.0030.04020.99
5.6.90.0070.07321.10
5.6.80.0100.07720.52
5.6.70.0130.04320.39
5.5.350.0230.04320.42
5.5.340.0070.08017.95
5.5.330.0030.07320.23
5.5.320.0030.04020.26
5.5.310.0300.07020.20
5.5.300.0070.06717.97
5.5.290.0030.06317.96
5.5.280.0100.04020.89
5.5.270.0070.05320.98
5.5.260.0070.08320.86
5.5.250.0130.08020.50
5.5.240.0070.08020.27
5.4.450.0030.08319.57
5.4.440.0070.05019.20
5.4.430.0070.04019.52
5.4.420.0070.07719.40
5.4.410.0070.07319.07
5.4.400.0130.07319.20
5.4.390.0130.05018.92
5.4.380.0070.03718.93
5.4.370.0000.04018.88
5.4.360.0000.04019.23
5.4.350.0070.04019.25
5.4.340.0100.07019.14
5.4.320.0130.05719.12
5.4.310.0000.05019.00
5.4.300.0070.05019.24
5.4.290.0030.07318.92
5.4.280.0100.07318.87
5.4.270.0100.06718.88
5.4.260.0100.07719.14
5.4.250.0100.07718.86
5.4.240.0070.07719.14
5.4.230.0000.05719.23
5.4.220.0100.07319.23
5.4.210.0100.07019.15
5.4.200.0070.06319.14
5.4.190.0200.03718.84
5.4.180.0100.05319.23
5.4.170.0070.04019.11
5.4.160.0100.03319.12
5.4.150.0070.06718.95
5.4.140.0070.04016.36
5.4.130.0030.03716.43
5.4.120.0000.04016.54
5.4.110.0100.03316.38
5.4.100.0070.04016.48
5.4.90.0000.07316.36
5.4.80.0070.03716.38
5.4.70.0130.04016.44
5.4.60.0100.05016.27
5.4.50.0030.06716.40
5.4.40.0100.03316.36
5.4.30.0100.03316.34
5.4.20.0100.04716.39
5.4.10.0100.06016.34
5.4.00.0030.07715.83
5.3.290.0070.03714.75
5.3.280.0030.04014.61
5.3.270.0100.06014.67
5.3.260.0000.04314.63
5.3.250.0000.04014.67
5.3.240.0070.05014.53
5.3.230.0200.03714.50
5.3.220.0070.07714.63
5.3.210.0130.06014.73
5.3.200.0100.07014.65
5.3.190.0230.03314.60
5.3.180.0130.04714.59
5.3.170.0000.04314.46
5.3.160.0100.05314.63
5.3.150.0030.06714.72
5.3.140.0100.04314.56
5.3.130.0100.07014.57
5.3.120.0100.07314.57
5.3.110.0030.07014.57
5.3.100.0100.05314.07
5.3.90.0030.08014.05
5.3.80.0100.07014.10
5.3.70.0030.04314.02
5.3.60.0070.07313.91
5.3.50.0200.06313.88
5.3.40.0170.06713.97
5.3.30.0100.04313.81
5.3.20.0070.07313.76
5.3.10.0030.04713.58
5.3.00.0030.04313.69
5.2.170.0030.06311.17
5.2.160.0030.03711.23
5.2.150.0030.04711.16
5.2.140.0070.06011.11
5.2.130.0070.03011.06
5.2.120.0100.05711.11
5.2.110.0030.05711.00
5.2.100.0200.02311.07
5.2.90.0100.05711.17
5.2.80.0030.04011.07
5.2.70.0070.03711.11
5.2.60.0170.05010.94
5.2.50.0030.03711.10
5.2.40.0030.05710.97
5.2.30.0230.02310.87
5.2.20.0130.03311.12
5.2.10.0000.04310.92
5.2.00.0030.06710.61
5.1.60.0070.0479.98
5.1.50.0030.03310.07
5.1.40.0070.0379.97
5.1.30.0100.05010.42
5.1.20.0030.03310.36
5.1.10.0000.0339.99
5.1.00.0170.04010.13
5.0.50.0070.0338.46
5.0.40.0000.0378.57
5.0.30.0130.0408.16
5.0.20.0100.0378.12
5.0.10.0070.0308.23
5.0.00.0070.0278.21
4.4.90.0000.0277.82
4.4.80.0000.0237.82
4.4.70.0000.0307.82
4.4.60.0030.0207.82
4.4.50.0030.0177.82
4.4.40.0030.0277.82
4.4.30.0070.0207.82
4.4.20.0030.0237.82
4.4.10.0000.0377.82
4.4.00.0000.0377.82
4.3.110.0000.0177.82
4.3.100.0070.0307.82
4.3.90.0070.0137.82
4.3.80.0000.0377.82
4.3.70.0000.0207.82
4.3.60.0070.0207.82
4.3.50.0070.0337.82
4.3.40.0030.0437.82
4.3.30.0000.0377.82
4.3.20.0030.0307.82
4.3.10.0000.0277.82
4.3.00.0000.0277.82

preferences:
42.4 ms | 401 KiB | 5 Q