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'); return $reflectionClass->getProperty('answer')->getValue(); } } $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.70.0130.00716.88
8.3.60.0140.00718.46
8.3.50.0110.00922.11
8.3.40.0060.00918.67
8.3.30.0120.00619.14
8.3.20.0040.00420.29
8.3.10.0040.00422.09
8.3.00.0040.00422.43
8.2.180.0140.00318.41
8.2.170.0100.01022.96
8.2.160.0100.00320.34
8.2.150.0030.00524.18
8.2.140.0040.01424.66
8.2.130.0100.01026.16
8.2.120.0040.00719.23
8.2.110.0090.00022.18
8.2.100.0040.00719.30
8.2.90.0030.00619.09
8.2.80.0000.00818.05
8.2.70.0030.00717.50
8.2.60.0050.00317.93
8.2.50.0040.00718.07
8.2.40.0000.00818.16
8.2.30.0040.00417.92
8.2.20.0000.00917.65
8.2.10.0000.00819.48
8.2.00.0040.00417.80
8.1.280.0090.00925.92
8.1.270.0110.00422.14
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0030.00623.97
8.1.230.0120.00019.12
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0050.00317.53
8.1.180.0030.00518.10
8.1.170.0080.00018.59
8.1.160.0100.00022.07
8.1.150.0000.00718.70
8.1.140.0040.00417.38
8.1.130.0030.00317.82
8.1.120.0060.00317.55
8.1.110.0030.00617.43
8.1.100.0070.00017.45
8.1.90.0040.00417.43
8.1.80.0000.00717.44
8.1.70.0000.00717.50
8.1.60.0060.00317.60
8.1.50.0040.00417.45
8.1.40.0050.00317.54
8.1.30.0060.00317.63
8.1.20.0040.00417.65
8.1.10.0050.00317.55
8.1.00.0040.00417.50
8.0.300.0000.00718.77
8.0.290.0000.00717.03
8.0.280.0040.00418.41
8.0.270.0000.00717.20
8.0.260.0030.00316.75
8.0.250.0030.00517.00
8.0.240.0030.00616.98
8.0.230.0000.00716.98
8.0.220.0030.00316.86
8.0.210.0030.00316.94
8.0.200.0030.00316.98
8.0.190.0000.00816.86
8.0.180.0040.00416.91
8.0.170.0080.00016.84
8.0.160.0000.00716.87
8.0.150.0030.00516.85
8.0.140.0050.00216.94
8.0.130.0000.00513.50
8.0.120.0000.00716.95
8.0.110.0070.00016.95
8.0.100.0040.00416.92
8.0.90.0050.00317.04
8.0.80.0090.00616.91
8.0.70.0000.00716.95
8.0.60.0020.00516.95
8.0.50.0020.00517.04
8.0.30.0110.00917.05
8.0.20.0100.01017.42
8.0.10.0000.00716.95
8.0.00.0110.00716.64
7.4.330.0020.00215.00
7.4.320.0000.00616.63
7.4.300.0060.00016.48
7.4.290.0070.00016.59
7.4.280.0080.00016.64
7.4.270.0030.00316.64
7.4.260.0030.00316.50
7.4.250.0040.00416.45
7.4.240.0020.00516.59
7.4.230.0070.00016.34
7.4.220.0090.01016.50
7.4.210.0100.00516.62
7.4.200.0030.00316.69
7.4.190.0000.00716.62
7.4.160.0040.01216.35
7.4.150.0090.01217.40
7.4.140.0070.01017.86
7.4.130.0040.01616.47
7.4.120.0120.00516.71
7.4.110.0060.00916.55
7.4.100.0070.01116.58
7.4.90.0100.00716.52
7.4.80.0150.00919.39
7.4.70.0070.01016.58
7.4.60.0140.00316.74
7.4.50.0000.00516.30
7.4.40.0080.00422.77
7.4.30.0060.00916.64
7.4.00.0070.00715.14
7.3.330.0030.00313.19
7.3.320.0020.00213.22
7.3.310.0000.00716.27
7.3.300.0060.00016.41
7.3.290.0120.00916.29
7.3.280.0090.00916.34
7.3.270.0170.00017.40
7.3.260.0280.02116.66
7.3.250.0110.00716.59
7.3.240.0100.01116.44
7.3.230.0030.01316.58
7.3.210.0100.00716.43
7.3.200.0090.01219.39
7.3.190.0090.00916.41
7.3.180.0120.00616.53
7.3.170.0090.01316.51
7.3.160.0080.00816.33
7.3.120.0130.00314.94
7.2.330.0100.00616.55
7.2.320.0120.01216.40
7.2.310.0090.00916.66
7.2.300.0070.01116.64
7.2.290.0030.01716.64
7.2.60.0130.00316.99
7.2.00.0060.00619.32
7.1.200.0000.01215.78
7.1.100.0070.00718.07
7.1.70.0060.00317.13
7.1.60.0100.01419.82
7.1.50.0040.01816.82
7.1.00.0030.07722.29
7.0.200.0060.00316.61
7.0.140.0000.07722.01
7.0.60.0170.08019.93
7.0.50.0030.04017.82
7.0.40.0100.08020.13
7.0.30.0330.05720.19
7.0.20.0370.07720.23
7.0.10.0170.05320.45
7.0.00.0200.07320.16
5.6.280.0000.07720.87
5.6.210.0130.08020.68
5.6.200.0070.07018.16
5.6.190.0100.07020.55
5.6.180.3070.04020.34
5.6.170.0130.04320.71
5.6.160.0130.03320.37
5.6.150.0070.05018.28
5.6.140.0030.06718.19
5.6.130.0130.08018.14
5.6.120.0100.05320.93
5.6.110.0070.06721.00
5.6.100.0100.06320.99
5.6.90.0130.07720.89
5.6.80.0070.06720.43
5.6.70.0370.07020.48
5.5.350.0100.07320.41
5.5.340.0070.05717.99
5.5.330.0030.04320.19
5.5.320.0330.07320.42
5.5.310.0200.04720.30
5.5.300.0070.07717.95
5.5.290.0100.03317.95
5.5.280.0070.06020.78
5.5.270.0200.07720.89
5.5.260.0030.04320.77
5.5.250.0070.09020.80
5.5.240.0030.07020.38
5.4.450.0630.06719.48
5.4.440.0800.05019.39
5.4.430.0130.05719.42
5.4.420.0170.05019.58
5.4.410.0100.06019.27
5.4.400.0670.00018.61
5.4.390.1600.00018.78
5.4.380.0270.05018.63
5.4.370.0230.05718.73
5.4.360.0130.05718.71
5.4.350.0270.05718.54
5.4.340.0300.05018.63
5.4.320.0080.04512.52
5.4.310.0090.03812.51
5.4.300.0070.04112.52
5.4.290.0100.04512.50
5.4.280.0070.04412.41
5.4.270.0170.06318.94
5.4.260.0170.05718.65
5.4.250.0070.08019.09
5.4.240.0030.06018.94
5.4.230.0130.06719.00
5.4.220.0070.08718.84
5.4.210.0170.04718.77
5.4.200.0130.05018.96
5.4.190.0270.03718.76
5.4.180.0130.05718.98
5.4.170.0100.05018.97
5.4.160.0100.06018.76
5.4.150.0070.08018.78
5.4.140.0030.08316.34
5.4.130.0070.05016.41
5.4.120.0230.06316.36
5.4.110.0230.04016.47
5.4.100.0100.05716.37
5.4.90.0170.06016.48
5.4.80.0170.05716.45
5.4.70.0200.06016.52
5.4.60.0100.07716.63
5.4.50.0170.06016.62
5.4.40.0170.05016.60
5.4.30.0200.04016.48
5.4.20.0130.06716.32
5.4.10.0170.05716.30
5.4.00.0170.05315.88
5.3.290.0060.04512.80
5.3.280.0070.05014.70
5.3.270.0200.07014.66
5.3.260.0100.06314.79
5.3.250.0100.05014.52
5.3.240.0030.06714.60
5.3.230.0130.05714.77
5.3.220.0100.04714.55
5.3.210.0070.05714.76
5.3.200.0100.05714.64
5.3.190.0100.06014.71
5.3.180.0170.05314.71
5.3.170.0200.05014.59
5.3.160.0100.07314.59
5.3.150.0130.07014.80
5.3.140.0100.07314.48
5.3.130.0070.05714.74
5.3.120.0130.05714.70
5.3.110.0130.07014.57
5.3.100.0100.05314.14
5.3.90.0130.07014.04
5.3.80.0070.05314.10
5.3.70.0100.07014.20
5.3.60.0170.05314.07
5.3.50.0100.05713.94
5.3.40.0130.04714.21
5.3.30.0200.04014.00
5.3.20.0130.04313.88
5.3.10.0130.04713.66
5.3.00.0100.04713.72
5.2.170.0170.05011.23
5.2.160.0100.04010.98
5.2.150.0070.05011.26
5.2.140.0130.04311.12
5.2.130.0130.05311.19
5.2.120.0100.04011.17
5.2.110.0000.04311.08
5.2.100.0130.05311.07
5.2.90.0100.04311.07
5.2.80.0030.04711.18
5.2.70.0100.05011.05
5.2.60.0030.05011.02
5.2.50.0230.06311.11
5.2.40.0130.03010.96
5.2.30.0130.03711.14
5.2.20.0170.04010.96
5.2.10.0100.03710.86
5.2.00.0070.05310.72
5.1.60.0070.03310.10
5.1.50.0170.03010.16
5.1.40.0100.03010.05
5.1.30.0130.04710.42
5.1.20.0170.02710.54
5.1.10.0130.04310.14
5.1.00.0070.04710.17
5.0.50.0000.0308.60
5.0.40.0070.0338.48
5.0.30.0130.0408.48
5.0.20.0000.0408.44
5.0.10.0070.0238.27
5.0.00.0030.0538.22
4.4.90.0130.0236.93
4.4.80.0130.0236.93
4.4.70.0000.0276.93
4.4.60.0000.0276.93
4.4.50.0000.0236.93
4.4.40.0130.0376.93
4.4.30.0000.0336.93
4.4.20.0100.0176.93
4.4.10.0000.0336.93
4.4.00.0030.0376.93
4.3.110.0000.0236.93
4.3.100.0000.0436.93
4.3.90.0100.0176.93
4.3.80.0000.0376.93
4.3.70.0030.0306.93
4.3.60.0030.0206.93
4.3.50.0000.0236.93
4.3.40.0070.0406.93
4.3.30.0000.0306.93
4.3.20.0030.0276.93
4.3.10.0000.0306.93
4.3.00.0000.0236.15

preferences:
42.15 ms | 401 KiB | 5 Q