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.70.0100.01016.25
8.3.60.0030.01416.63
8.3.50.0100.00817.49
8.3.40.0040.01118.82
8.3.30.0160.00618.80
8.3.20.0080.00018.86
8.3.10.0080.00018.77
8.3.00.0040.00419.25
8.2.180.0150.00016.63
8.2.170.0090.00622.96
8.2.160.0080.00819.04
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0070.00019.54
8.2.110.0070.00321.06
8.2.100.0040.00817.91
8.2.90.0000.00817.97
8.2.80.0090.00019.82
8.2.70.0030.00717.63
8.2.60.0040.00417.93
8.2.50.0040.00418.04
8.2.40.0050.00319.48
8.2.30.0060.00317.72
8.2.20.0060.00317.67
8.2.10.0040.00417.64
8.2.00.0050.00217.69
8.1.280.0170.00325.92
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00320.76
8.1.230.0060.00622.16
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0030.00517.23
8.1.190.0000.00817.38
8.1.180.0000.00818.10
8.1.170.0050.00317.62
8.1.160.0070.00019.03
8.1.150.0000.00718.56
8.1.140.0000.00717.56
8.1.130.0030.00619.14
8.1.120.0070.00017.52
8.1.110.0070.00017.36
8.1.100.0000.00817.37
8.1.90.0040.00417.39
8.1.80.0030.00317.36
8.1.70.0070.00017.40
8.1.60.0040.00417.48
8.1.50.0040.00417.46
8.1.40.0040.00417.54
8.1.30.0060.00317.54
8.1.20.0110.00017.67
8.1.10.0040.00417.50
8.1.00.0000.00817.58
8.0.300.0070.00219.98
8.0.290.0060.00316.63
8.0.280.0030.00318.59
8.0.270.0030.00317.32
8.0.260.0000.00816.92
8.0.250.0050.00217.00
8.0.240.0080.00017.07
8.0.230.0000.00816.89
8.0.220.0070.00016.94
8.0.210.0000.00717.05
8.0.200.0040.00417.04
8.0.190.0030.00417.03
8.0.180.0040.00416.98
8.0.170.0030.00617.02
8.0.160.0030.00316.97
8.0.150.0080.00016.98
8.0.140.0070.00316.79
8.0.130.0030.00313.41
8.0.120.0000.01016.80
8.0.110.0000.00716.95
8.0.100.0000.00716.98
8.0.90.0000.00716.84
8.0.80.0130.00716.84
8.0.70.0040.00416.96
8.0.60.0040.00416.75
8.0.50.0030.00516.86
8.0.30.0120.00817.28
8.0.20.0130.00617.09
8.0.10.0040.00416.93
8.0.00.0070.01316.78
7.4.330.0040.00413.04
7.4.320.0000.00616.54
7.4.300.0000.00616.66
7.4.290.0000.00716.51
7.4.280.0080.00016.55
7.4.270.0030.00316.56
7.4.260.0050.00013.27
7.4.250.0000.00916.40
7.4.240.0000.00716.41
7.4.230.0030.00316.54
7.4.220.0170.00716.47
7.4.210.0110.00716.62
7.4.200.0000.00716.36
7.4.190.0000.00816.58
7.4.160.0120.00416.49
7.4.150.0060.01216.43
7.4.140.0160.00517.86
7.4.130.0150.00316.55
7.4.120.0040.01316.43
7.4.110.0090.01216.59
7.4.100.0100.01016.46
7.4.90.0120.01216.38
7.4.80.0030.01419.39
7.4.70.0100.00716.66
7.4.60.0130.00616.57
7.4.50.0060.00316.59
7.4.40.0110.00316.70
7.4.30.0040.01316.75
7.4.00.0120.00615.02
7.3.330.0030.00413.22
7.3.320.0050.00313.12
7.3.310.0030.00316.39
7.3.300.0030.00316.30
7.3.290.0080.01016.31
7.3.280.0030.01216.32
7.3.270.0030.01516.40
7.3.260.0160.00316.39
7.3.240.0120.01216.41
7.3.230.0110.00716.38
7.3.210.0140.00716.37
7.3.200.0110.00616.41
7.3.190.0050.01116.49
7.3.180.0030.01416.41
7.3.170.0120.00916.46
7.3.160.0090.00616.51
7.3.120.0120.00314.70
7.3.10.0150.00416.33
7.3.00.0060.00916.53
7.2.330.0140.00416.75
7.2.320.0170.00716.73
7.2.310.0070.01316.71
7.2.300.0090.00916.49
7.2.290.0090.00916.48
7.2.130.0040.01116.70
7.2.120.0140.00016.76
7.2.110.0090.00616.69
7.2.100.0110.00716.47
7.2.90.0130.00016.82
7.2.80.0060.00916.52
7.2.70.0060.00916.68
7.2.60.0120.00616.66
7.2.50.0120.00416.60
7.2.40.0100.00716.72
7.2.30.0030.01316.68
7.2.20.0070.01016.76
7.2.10.0130.00316.60
7.2.00.0070.00418.08
7.1.250.0060.01015.71
7.1.240.0030.01215.67
7.1.230.0070.00715.52
7.1.220.0140.00415.67
7.1.210.0070.01115.39
7.1.200.0070.00715.46
7.1.190.0120.00015.60
7.1.180.0070.01015.62
7.1.170.0060.00615.55
7.1.160.0120.00615.61
7.1.150.0060.00615.35
7.1.140.0070.00715.49
7.1.130.0060.01015.51
7.1.120.0110.00715.68
7.1.110.0100.00715.72
7.1.100.0100.00715.56
7.1.90.0070.00715.59
7.1.80.0130.00315.44
7.1.70.0040.00716.42
7.1.60.0070.00516.38
7.1.50.0110.00916.23
7.1.40.0110.00015.64
7.1.30.0100.00715.60
7.1.20.0080.00415.36
7.1.10.0110.00015.66
7.1.00.0050.03419.04
7.0.330.0100.00715.45
7.0.320.0120.00315.26
7.0.310.0030.01215.17
7.0.300.0080.00815.19
7.0.290.0090.00615.29
7.0.280.0090.00315.05
7.0.270.0100.00314.92
7.0.260.0100.00615.14
7.0.250.0070.00715.30
7.0.240.0130.00015.30
7.0.230.0040.01115.23
7.0.220.0030.00915.27
7.0.210.0090.00615.32
7.0.200.0080.00816.09
7.0.190.0090.00415.09
7.0.180.0060.00915.43
7.0.170.0030.01015.13
7.0.160.0080.00314.99
7.0.150.0100.00315.26
7.0.140.0130.03518.57
7.0.130.0150.00715.43
7.0.120.0080.03918.74
7.0.110.0100.00615.16
7.0.100.0060.00614.93
7.0.90.0070.01115.11
7.0.80.0090.00915.25
7.0.70.0130.00314.90
7.0.60.0080.04317.72
7.0.50.0130.04216.38
7.0.40.0030.05015.41
7.0.30.0050.04815.52
7.0.20.0100.03815.46
7.0.10.0110.03115.43
7.0.00.0070.02415.47
5.6.380.0040.00814.29
5.6.370.0120.00714.75
5.6.360.0090.00914.66
5.6.350.0070.01114.18
5.6.340.0150.00914.35
5.6.330.0150.00414.11
5.6.320.0050.01914.30
5.6.310.0160.00814.11
5.6.300.0090.01414.68
5.6.290.0200.00514.23
5.6.280.0030.04717.62
5.6.270.0140.00714.09
5.6.260.0120.00914.42
5.6.250.0160.00614.39
5.6.240.0140.00214.39
5.6.230.0150.00914.24
5.6.220.0110.01114.31
5.6.210.0110.03717.49
5.6.200.0060.04616.09
5.6.190.0100.04716.33
5.6.180.0080.04616.12
5.6.170.0180.03816.27
5.6.160.0140.03416.16
5.6.150.0080.03316.36
5.6.140.0090.04516.13
5.6.130.0050.03416.15
5.6.120.0070.04216.29
5.6.110.0050.02416.18
5.6.100.0080.04016.17
5.6.90.0060.03616.21
5.6.80.0030.03115.77
5.6.70.0060.02015.85
5.6.60.0050.04215.85
5.6.50.0070.03715.96
5.6.40.0050.03515.78
5.6.30.0070.03515.73
5.6.20.0140.03615.84
5.6.10.0080.03615.68
5.6.00.0030.03015.77
5.5.380.0110.00411.26
5.5.370.0100.00711.06
5.5.360.0070.01011.13
5.5.350.0140.04315.70
5.5.340.0070.02414.52
5.5.330.0080.04314.72
5.5.320.0110.03814.65
5.5.310.0140.03814.59
5.5.300.0100.03814.64
5.5.290.0030.04214.61
5.5.280.0050.04214.53
5.5.270.0100.02714.40
5.5.260.0050.04714.57
5.5.250.0070.04014.38
5.5.240.0030.02514.18
5.5.230.0050.03314.23
5.5.220.0100.02814.16
5.5.210.0000.03014.06
5.5.200.0080.02314.33
5.5.190.0030.04314.29
5.5.180.0070.02714.17
5.5.170.0060.00311.15
5.5.160.0130.03514.17
5.5.150.0020.02414.20
5.5.140.0040.02114.20
5.5.130.0080.03414.12
5.5.120.0060.03114.08
5.5.110.0030.04114.08
5.5.100.0110.03314.17
5.5.90.0050.03714.04
5.5.80.0050.03714.00
5.5.70.0030.02914.16
5.5.60.0000.04413.91
5.5.50.0050.03313.99
5.5.40.0060.02013.93
5.5.30.0060.02214.08
5.5.20.0050.02614.13
5.5.10.0050.02514.11
5.5.00.0080.03613.93
5.4.450.0070.04415.19
5.4.440.0050.04615.28
5.4.430.0090.02015.23
5.4.420.0050.02715.25
5.4.410.0110.03515.18
5.4.400.0130.03515.02
5.4.390.0020.03114.96
5.4.380.0070.04015.05
5.4.370.0070.02414.98
5.4.360.0070.01915.02
5.4.350.0100.02814.88
5.4.340.0080.02615.03
5.4.330.0000.00611.05
5.4.320.0060.02814.87
5.4.310.0080.02015.04
5.4.300.0050.02614.90
5.4.290.0100.03315.02
5.4.280.0050.04315.05
5.4.270.0070.03814.98
5.4.260.0120.03615.03
5.4.250.0100.03115.06
5.4.240.0070.03814.84
5.4.230.0000.03014.98
5.4.220.0020.02814.79
5.4.210.0080.03314.85
5.4.200.0070.04014.89
5.4.190.0060.04214.93
5.4.180.0080.04014.97
5.4.170.0030.04514.90
5.4.160.0060.03814.85
5.4.150.0050.04015.11
5.4.140.0060.02413.80
5.4.130.0060.02413.55
5.4.120.0050.03613.65
5.4.110.0070.03713.63
5.4.100.0050.04113.68
5.4.90.0050.03513.65
5.4.80.0030.04213.70
5.4.70.0070.03413.57
5.4.60.0030.03813.66
5.4.50.0020.03613.54
5.4.40.0030.04113.72
5.4.30.0040.02113.67
5.4.20.0080.02513.64
5.4.10.0080.02013.44
5.4.00.0040.03213.25
5.3.290.0090.02712.71
5.3.280.0060.02912.47
5.3.270.0080.03312.53
5.3.260.0050.03312.61
5.3.250.0090.03212.65
5.3.240.0080.02812.52
5.3.230.0050.02712.51
5.3.220.0030.04012.64
5.3.210.0030.04112.53
5.3.200.0030.03412.53
5.3.190.0070.03612.45
5.3.180.0090.03512.51
5.3.170.0070.03812.50
5.3.160.0090.04012.52
5.3.150.0050.04212.51
5.3.140.0060.04112.60
5.3.130.0080.01912.58
5.3.120.0030.03812.60
5.3.110.0070.03012.56
5.3.100.0080.02512.30
5.3.90.0070.04012.33
5.3.80.0040.03412.26
5.3.70.0030.02612.26
5.3.60.0100.03812.31
5.3.50.0080.02812.23
5.3.40.0070.03212.33
5.3.30.0040.02412.24
5.3.20.0080.03912.16
5.3.10.0080.03112.01
5.3.00.0120.02311.92
5.2.170.0040.02310.40
5.2.160.0070.03310.43
5.2.150.0070.01810.32
5.2.140.0070.03410.39
5.2.130.0050.02910.28
5.2.120.0030.03310.25
5.2.110.0070.02310.38
5.2.100.0060.03110.31
5.2.90.0070.03310.34
5.2.80.0050.02810.18
5.2.70.0060.03310.34
5.2.60.0080.02010.16
5.2.50.0070.03210.28
5.2.40.0050.03010.29
5.2.30.0070.03410.11
5.2.20.0140.02710.14
5.2.10.0070.03110.14
5.2.00.0040.0339.96
5.1.60.0060.0149.40
5.1.50.0050.0279.42
5.1.40.0050.0139.39
5.1.30.0030.0189.59
5.1.20.0040.0319.65
5.1.10.0040.0269.47
5.1.00.0040.0309.50
5.0.50.0050.0118.71
5.0.40.0050.0138.64
5.0.30.0070.0288.56
5.0.20.0030.0108.57
5.0.10.0040.0128.50
5.0.00.0050.0208.49
4.4.90.0020.0188.33
4.4.80.0010.0198.33
4.4.70.0090.0118.33
4.4.60.0020.0178.33
4.4.50.0030.0198.33
4.4.40.0080.0268.33
4.4.30.0000.0148.33
4.4.20.0080.0138.33
4.4.10.0000.0158.33
4.4.00.0040.0148.33
4.3.110.0040.0128.33
4.3.100.0020.0108.33
4.3.90.0020.0108.33
4.3.80.0030.0298.33
4.3.70.0070.0158.33
4.3.60.0020.0208.33
4.3.50.0070.0138.33
4.3.40.0050.0258.33
4.3.30.0050.0158.33
4.3.20.0020.0228.33
4.3.10.0000.0208.33
4.3.00.0040.0208.33

preferences:
81.48 ms | 401 KiB | 5 Q