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 E extends Exception{ public function getAnswer($question) { $reflectionClass = new ReflectionClass('Question'); $property = $reflectionClass->getProperty('answer'); $property->setAccessible(true); return $property->getValue(new Question); } } $e = new E; // 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.0130.00318.31
8.3.50.0140.00722.05
8.3.40.0120.00618.93
8.3.30.0140.00019.22
8.3.20.0100.00620.13
8.3.10.0040.00422.10
8.3.00.0050.00322.44
8.2.180.0130.00917.00
8.2.170.0090.01222.96
8.2.160.0030.01020.52
8.2.150.0060.00324.18
8.2.140.0150.00324.66
8.2.130.0000.00726.16
8.2.120.0070.00319.48
8.2.110.0030.00622.27
8.2.100.0060.00619.29
8.2.90.0000.00819.17
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0000.00817.80
8.2.50.0090.00018.07
8.2.40.0080.00018.03
8.2.30.0050.00317.95
8.2.20.0000.01117.82
8.2.10.0050.00319.52
8.2.00.0030.00517.64
8.1.280.0070.00725.92
8.1.270.0110.00421.97
8.1.260.0050.00326.35
8.1.250.0090.00028.09
8.1.240.0080.00023.96
8.1.230.0110.00019.07
8.1.220.0050.00317.77
8.1.210.0040.00418.77
8.1.200.0030.00617.47
8.1.190.0040.00417.41
8.1.180.0000.00818.10
8.1.170.0000.00818.69
8.1.160.0030.00622.05
8.1.150.0050.00218.66
8.1.140.0030.00517.50
8.1.130.0030.00317.80
8.1.120.0000.00717.52
8.1.110.0030.00617.50
8.1.100.0030.00317.45
8.1.90.0000.00817.32
8.1.80.0000.00717.53
8.1.70.0000.00717.39
8.1.60.0060.00317.66
8.1.50.0070.00017.53
8.1.40.0040.00417.43
8.1.30.0040.00417.68
8.1.20.0030.00617.61
8.1.10.0020.00517.57
8.1.00.0000.00717.56
8.0.300.0070.00018.77
8.0.290.0000.00717.05
8.0.280.0030.00318.48
8.0.270.0030.00317.23
8.0.260.0030.00316.91
8.0.250.0080.00017.06
8.0.240.0070.00316.88
8.0.230.0030.00317.02
8.0.220.0070.00016.81
8.0.210.0030.00316.82
8.0.200.0000.00716.96
8.0.190.0040.00416.98
8.0.180.0040.00416.87
8.0.170.0030.00517.02
8.0.160.0000.00716.87
8.0.150.0000.00716.89
8.0.140.0000.00716.92
8.0.130.0030.00313.39
8.0.120.0040.00416.96
8.0.110.0080.00017.00
8.0.100.0000.00716.78
8.0.90.0000.00716.80
8.0.80.0090.01316.95
8.0.70.0000.00816.97
8.0.60.0000.00716.79
8.0.50.0080.00016.91
8.0.30.0150.00517.16
8.0.20.0080.01417.40
8.0.10.0040.00417.16
8.0.00.0110.01216.81
7.4.330.0050.00015.09
7.4.320.0000.00616.69
7.4.300.0000.00816.54
7.4.290.0000.00716.66
7.4.280.0070.00016.55
7.4.270.0080.00016.63
7.4.260.0000.00716.45
7.4.250.0040.00416.60
7.4.240.0020.00516.56
7.4.230.0070.00016.45
7.4.220.0090.00916.68
7.4.210.0080.00916.52
7.4.200.0030.00316.59
7.4.190.0000.00816.70
7.4.160.0070.01416.48
7.4.150.0070.01117.40
7.4.140.0060.01117.86
7.4.130.0100.00916.62
7.4.120.0090.01116.66
7.4.110.0080.00816.62
7.4.100.0120.00816.70
7.4.90.0130.00616.36
7.4.80.0090.00919.39
7.4.70.0030.01416.55
7.4.60.0090.00916.47
7.4.50.0000.00916.46
7.4.40.0030.01322.77
7.4.30.0040.01116.47
7.4.00.0060.00615.23
7.3.330.0000.00513.33
7.3.320.0000.00513.37
7.3.310.0000.00716.48
7.3.300.0030.00316.25
7.3.290.0020.01716.34
7.3.280.0050.01316.38
7.3.270.0120.00817.40
7.3.260.0070.01016.62
7.3.250.0050.01516.37
7.3.240.0040.01216.63
7.3.230.0060.01216.52
7.3.210.0070.01016.44
7.3.200.0070.00319.39
7.3.190.0140.00316.61
7.3.180.0080.00816.46
7.3.170.0030.01316.47
7.3.160.0120.00316.20
7.3.120.0030.01314.77
7.3.110.0040.01415.11
7.3.100.0060.01014.86
7.3.90.0040.00415.06
7.3.80.0090.00314.61
7.3.70.0000.01314.63
7.3.60.0060.00614.98
7.3.50.0060.00314.88
7.3.40.0030.00614.88
7.3.30.0070.00714.95
7.3.20.0030.00916.72
7.3.10.0070.00316.52
7.3.00.0000.01216.37
7.2.330.0000.01616.54
7.2.320.0100.01016.72
7.2.310.0110.00616.43
7.2.300.0150.00316.55
7.2.290.0150.00916.41
7.2.240.0030.01014.92
7.2.230.0040.01115.21
7.2.220.0000.00815.19
7.2.210.0110.00314.75
7.2.200.0000.01615.04
7.2.190.0070.00414.76
7.2.180.0070.00714.96
7.2.170.0030.00914.85
7.2.160.0030.00615.17
7.2.150.0060.00616.62
7.2.140.0040.01116.95
7.2.130.0090.00616.87
7.2.120.0090.00616.91
7.2.110.0000.01316.98
7.2.100.0000.01617.00
7.2.90.0060.00316.98
7.2.80.0030.00616.97
7.2.70.0090.00916.86
7.2.60.0050.01016.95
7.2.50.0050.00916.96
7.2.40.0150.00316.96
7.2.30.0090.00616.83
7.2.20.0060.00616.60
7.2.10.0030.00616.70
7.2.00.0030.01018.15
7.1.330.0070.01015.81
7.1.320.0030.00515.75
7.1.310.0060.00615.73
7.1.300.0030.01315.60
7.1.290.0080.00415.73
7.1.280.0040.01115.99
7.1.270.0030.01015.64
7.1.260.0000.01515.59
7.1.250.0030.00915.93
7.1.200.0100.00315.55
7.1.100.0040.01118.06
7.1.70.0000.00717.18
7.1.60.0150.00919.82
7.1.50.0070.01316.91
7.1.00.0000.07722.57
7.0.200.0250.00314.99
7.0.140.0030.07322.15
7.0.100.0070.05019.98
7.0.90.0070.09019.80
7.0.80.0200.05319.94
7.0.70.0070.05019.79
7.0.60.0200.06719.93
7.0.50.0370.05320.16
7.0.40.0070.07320.14
7.0.30.0070.07020.13
7.0.20.0100.08020.09
7.0.10.0130.07720.04
7.0.00.0030.09020.08
5.6.280.0070.07021.00
5.6.250.0000.05320.65
5.6.240.0030.08020.59
5.6.230.0070.08320.57
5.6.220.0070.08720.54
5.6.210.0000.05320.69
5.6.200.0000.08320.94
5.6.190.0030.05020.94
5.6.180.0070.07721.09
5.6.170.0000.09320.93
5.6.160.0070.08321.01
5.6.150.0100.07720.99
5.6.140.0030.04320.95
5.6.130.0100.04721.07
5.6.120.0130.08021.02
5.6.110.0130.08021.13
5.6.100.0000.09320.99
5.6.90.0130.08021.07
5.6.80.0030.06720.48
5.6.70.0100.08020.40
5.6.60.0170.06720.40
5.6.50.0100.04020.46
5.6.40.0070.04020.43
5.6.30.0100.03720.32
5.6.20.0030.06320.53
5.6.10.0170.06720.40
5.6.00.0030.08720.37
5.5.380.0130.07720.52
5.5.370.0130.03720.42
5.5.360.0070.08720.29
5.5.350.0100.04320.32
5.5.340.0200.07020.84
5.5.330.0100.07720.80
5.5.320.0070.04020.88
5.5.310.0130.07720.90
5.5.300.0070.08020.83
5.5.290.0030.08720.84
5.5.280.0170.07720.81
5.5.270.0130.07720.88
5.5.260.0070.08020.82
5.5.250.0100.06720.74
5.5.240.0030.08320.23
5.5.230.0030.04720.16
5.5.220.0100.06320.11
5.5.210.0030.08320.22
5.5.200.0100.07720.10
5.5.190.0130.07320.24
5.5.180.0070.04020.24
5.5.160.0070.04720.16
5.5.150.0070.04320.23
5.5.140.0130.05020.26
5.5.130.0070.07720.00
5.5.120.0070.05020.08
5.5.110.0070.08020.26
5.5.100.0000.06720.09
5.5.90.0100.07020.08
5.5.80.0130.08720.07
5.5.70.0070.06720.05
5.5.60.0130.06720.16
5.5.50.0030.08020.11
5.5.40.0070.08020.11
5.5.30.0130.07320.13
5.5.20.0070.07720.10
5.5.10.0170.06320.04
5.5.00.0030.04720.01
5.4.450.0000.05019.45
5.4.440.0000.08319.55
5.4.430.0170.06719.46
5.4.420.0130.07319.23
5.4.410.0070.04319.36
5.4.400.0030.04718.86
5.4.390.0000.08318.90
5.4.380.0030.07718.95
5.4.370.0000.08019.05
5.4.360.0070.05018.85
5.4.350.0170.07319.12
5.4.340.0030.04019.16
5.4.320.0000.04718.89
5.4.310.0070.05319.12
5.4.300.0030.04718.94
5.4.290.0070.04019.05
5.4.280.0030.04319.23
5.4.270.0030.04319.13
5.4.260.0070.08318.94
5.4.250.0070.09018.87
5.4.240.0070.07718.87
5.4.230.0170.06719.12
5.4.220.0070.06018.94
5.4.210.0030.05719.22
5.4.200.0200.06719.02
5.4.190.0030.04719.11
5.4.180.0030.07319.08
5.4.170.0230.07319.22
5.4.160.0100.07319.10
5.4.150.0030.08019.02
5.4.140.0130.06016.47
5.4.130.0170.04316.38
5.4.120.0100.06716.46
5.4.110.0200.05716.45
5.4.100.0100.04316.45
5.4.90.0030.07716.41
5.4.80.0130.06316.40
5.4.70.0070.08316.54
5.4.60.0000.08016.46
5.4.50.0030.05016.48
5.4.40.0070.03716.51
5.4.30.0100.07016.39
5.4.20.0170.06016.30
5.4.10.0100.06316.39
5.4.00.0130.06715.88
5.3.290.0100.07314.78
5.3.280.0030.07714.61
5.3.270.0030.06714.66
5.3.260.0070.07314.54
5.3.250.0030.07714.73
5.3.240.0030.07714.68
5.3.230.0100.05714.56
5.3.220.0030.07014.61
5.3.210.0100.07014.55
5.3.200.0100.06314.59
5.3.190.0030.08014.64
5.3.180.0100.04314.49
5.3.170.0200.06314.71
5.3.160.0070.07014.66
5.3.150.0070.04714.62
5.3.140.0100.06714.56
5.3.130.0070.07714.67
5.3.120.0100.06714.49
5.3.110.0100.04014.64
5.3.100.0130.06314.06
5.3.90.0100.03713.97
5.3.80.0030.04014.02
5.3.70.0100.06313.93
5.3.60.0030.04713.93
5.3.50.0100.07014.05
5.3.40.0100.07014.10
5.3.30.0100.05713.80
5.3.20.0030.06713.81
5.3.10.0070.05713.66
5.3.00.0030.06013.55
5.2.170.0100.04312.11
5.2.160.0170.03712.11
5.2.150.0030.04312.11
5.2.140.0100.05012.11
5.2.130.0100.05012.11
5.2.120.0070.03012.11
5.2.110.0100.05012.11
5.2.100.0100.03012.11
5.2.90.0030.06012.11
5.2.80.0070.05012.11
5.2.70.0200.04712.11
5.2.60.0030.06012.11
5.2.50.0000.03712.11
5.2.40.0030.05712.11
5.2.30.0100.03312.11
5.2.20.0070.02712.11
5.2.10.0000.06712.11
5.2.00.0000.06312.11
5.1.60.0070.05012.11
5.1.50.0000.05712.11
5.1.40.0070.05012.11
5.1.30.0030.05712.11
5.1.20.0130.04312.11
5.1.10.0070.05012.11
5.1.00.0070.03312.11
5.0.50.0030.02012.11
5.0.40.0000.02012.11
5.0.30.0030.03312.11
5.0.20.0000.02312.11
5.0.10.0100.01012.11
5.0.00.0000.03312.11
4.4.90.0030.02312.11
4.4.80.0000.03712.11
4.4.70.0070.03012.11
4.4.60.0000.02312.11
4.4.50.0000.03712.11
4.4.40.0030.05012.11
4.4.30.0030.03012.11
4.4.20.0030.03312.11
4.4.10.0030.02012.11
4.4.00.0030.02712.11
4.3.110.0000.02312.11
4.3.100.0030.01312.11
4.3.90.0000.01712.11
4.3.80.0000.02312.11
4.3.70.0030.01312.11
4.3.60.0000.01712.11
4.3.50.0000.01712.11
4.3.40.0000.02312.11
4.3.30.0000.01712.11
4.3.20.0000.01712.11
4.3.10.0000.01712.11
4.3.00.0000.01712.11

preferences:
47.84 ms | 401 KiB | 5 Q