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 exceptionFun extends Exception { public function getAnswer($that) { $getTheAnswer = Closure::bind($this->getPrivate($that), null, $that); return $getTheAnswer; } public function getPrivate($that) { return $that->answer; } } $e = new exceptionFun(); // 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.00716.50
8.3.50.0110.00721.95
8.3.40.0130.00318.68
8.3.30.0140.00719.01
8.3.20.0070.00020.38
8.3.10.0030.00523.48
8.3.00.0050.00319.37
8.2.180.0160.00318.29
8.2.170.0150.00022.96
8.2.160.0120.00820.40
8.2.150.0080.00024.18
8.2.140.0150.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00022.11
8.2.110.0090.00021.89
8.2.100.0000.01117.78
8.2.90.0060.00319.09
8.2.80.0000.00817.97
8.2.70.0040.00417.60
8.2.60.0030.00617.67
8.2.50.0040.00418.07
8.2.40.0000.00819.95
8.2.30.0050.00217.90
8.2.20.0050.00317.71
8.2.10.0000.00819.91
8.2.00.0040.00417.64
8.1.280.0140.00425.92
8.1.270.0030.00523.87
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.88
8.1.230.0040.00719.02
8.1.220.0080.00017.74
8.1.210.0080.00018.77
8.1.200.0030.00617.23
8.1.190.0000.00817.53
8.1.180.0080.00318.10
8.1.170.0000.01018.50
8.1.160.0000.00722.05
8.1.150.0100.00018.68
8.1.140.0040.00417.47
8.1.130.0050.00317.92
8.1.120.0040.00417.51
8.1.110.0040.00417.40
8.1.100.0040.00417.46
8.1.90.0000.00817.41
8.1.80.0040.00417.55
8.1.70.0030.00317.38
8.1.60.0070.00317.65
8.1.50.0000.00717.50
8.1.40.0040.00417.56
8.1.30.0000.00817.49
8.1.20.0000.00717.70
8.1.10.0030.00617.64
8.1.00.0080.00017.59
8.0.300.0060.00320.83
8.0.290.0040.00417.04
8.0.280.0040.00418.42
8.0.270.0030.00317.12
8.0.260.0000.00618.41
8.0.250.0030.00317.00
8.0.240.0030.00516.96
8.0.230.0030.00316.98
8.0.220.0030.00316.83
8.0.210.0000.00716.81
8.0.200.0070.00017.02
8.0.190.0000.00717.05
8.0.180.0000.01016.96
8.0.170.0030.00516.82
8.0.160.0070.00016.86
8.0.150.0040.00416.82
8.0.140.0000.00716.94
8.0.130.0000.00613.37
8.0.120.0000.00816.95
8.0.110.0040.00416.88
8.0.100.0000.00717.00
8.0.90.0000.00716.77
8.0.80.0120.00216.99
8.0.70.0000.00817.03
8.0.60.0060.00317.11
8.0.50.0000.00717.00
8.0.30.0090.00917.32
8.0.20.0110.00817.40
8.0.10.0080.00017.09
8.0.00.0150.00616.69
7.4.330.0050.00015.00
7.4.320.0000.00616.41
7.4.300.0030.00316.48
7.4.290.0030.00316.45
7.4.280.0000.00716.63
7.4.270.0050.00316.55
7.4.260.0030.00316.52
7.4.250.0000.00816.62
7.4.240.0040.00416.47
7.4.230.0030.00316.74
7.4.220.0140.00316.66
7.4.210.0070.00916.61
7.4.200.0040.00416.63
7.4.190.0030.00316.60
7.4.160.0070.01016.44
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0080.01116.37
7.4.120.0090.01716.39
7.4.110.0140.00316.52
7.4.100.0120.00916.48
7.4.90.0080.00816.32
7.4.80.0100.01019.39
7.4.70.0070.01016.55
7.4.60.0130.00616.36
7.4.50.0040.00416.48
7.4.40.0070.01122.77
7.4.30.0120.00616.45
7.4.00.0110.00414.98
7.3.330.0000.00613.32
7.3.320.0000.00513.37
7.3.310.0030.00316.19
7.3.300.0090.00016.32
7.3.290.0090.01016.39
7.3.280.0090.00916.32
7.3.270.0160.00317.40
7.3.260.0120.00616.45
7.3.250.0090.01216.51
7.3.240.0070.01016.46
7.3.230.0120.01216.55
7.3.210.0060.01116.53
7.3.200.0100.01019.39
7.3.190.0160.00716.59
7.3.180.0150.00016.39
7.3.170.0110.00516.60
7.3.160.0040.01216.46
7.3.120.0070.01014.61
7.3.00.0060.00916.62
7.2.330.0030.01616.63
7.2.320.0060.01116.82
7.2.310.0100.00716.36
7.2.300.0120.00616.52
7.2.290.0070.01016.70
7.2.130.0060.00916.66
7.2.120.0030.00616.61
7.2.110.0110.00416.76
7.2.100.0070.00317.09
7.2.90.0060.01116.97
7.2.80.0080.00416.76
7.2.70.0040.01117.07
7.2.60.0080.00717.01
7.2.50.0000.01516.93
7.2.40.0040.00817.02
7.2.30.0000.01216.96
7.2.20.0000.01316.59
7.2.10.0070.01116.79
7.2.00.0100.00418.12
7.1.250.0100.00315.93
7.1.240.0000.01215.62
7.1.230.0030.00515.63
7.1.220.0000.01015.96
7.1.210.0060.00315.31
7.1.200.0070.00515.71
7.1.190.0030.00615.91
7.1.180.0030.01015.87
7.1.170.0080.00315.80
7.1.160.0040.00815.78
7.1.150.0000.01315.77
7.1.140.0090.00615.86
7.1.130.0070.00715.80
7.1.120.0070.00715.88
7.1.110.0060.00915.79
7.1.100.0040.00916.90
7.1.90.0070.00715.67
7.1.80.0000.01215.84
7.1.70.0050.00616.44
7.1.60.0060.00717.65
7.1.50.0040.00616.39
7.1.40.0000.01315.57
7.1.30.0040.00715.84
7.1.20.0030.00715.54
7.1.10.0130.00015.71
7.1.00.0080.03519.04
7.0.330.0030.00715.36
7.0.320.0040.00715.35
7.0.310.0100.00315.38
7.0.300.0080.00315.06
7.0.290.0030.01015.55
7.0.280.0090.00615.25
7.0.270.0040.00415.21
7.0.260.0070.01015.45
7.0.250.0020.00515.43
7.0.240.0030.01015.47
7.0.230.0070.00715.40
7.0.220.0060.00315.03
7.0.210.0060.00615.54
7.0.200.0040.00716.13
7.0.190.0000.01215.45
7.0.180.0000.00715.16
7.0.170.0070.00015.35
7.0.160.0040.00815.09
7.0.150.0060.00915.48
7.0.140.0020.04118.70
7.0.130.0030.01015.19
7.0.120.0060.00615.22
7.0.110.0030.00915.42
7.0.100.0030.00515.38
7.0.90.0030.00615.38
7.0.80.0030.00515.20
7.0.70.0040.00415.48
7.0.60.0110.03917.60
7.0.50.0060.04316.75
7.0.40.0070.04316.82
7.0.30.0250.04516.77
7.0.20.0120.04916.81
7.0.10.0100.02716.82
7.0.00.0020.04616.77
5.6.380.0040.00714.56
5.6.370.0060.00614.25
5.6.360.0030.01013.86
5.6.350.0070.00413.90
5.6.340.0120.00314.20
5.6.330.0060.00314.27
5.6.320.0040.01114.41
5.6.310.0040.01114.29
5.6.300.0100.00314.28
5.6.290.0000.01314.14
5.6.280.0030.03817.72
5.6.270.0040.00414.01
5.6.260.0030.01014.21
5.6.250.0000.01114.36
5.6.240.0070.00314.33
5.6.230.0100.00314.11
5.6.220.0030.00914.49
5.6.210.0080.04017.27
5.6.200.0090.03216.27
5.6.190.0090.04117.41
5.6.180.0120.03217.29
5.6.170.0170.03717.37
5.6.160.0090.02817.42
5.6.150.0020.03616.28
5.6.140.0070.02916.15
5.6.130.0070.02216.14
5.6.120.0040.02617.60
5.6.110.0120.04217.62
5.6.100.0080.04017.65
5.6.90.0070.04017.61
5.6.80.0070.04317.26
5.6.70.2150.02517.30
5.6.60.0080.00414.07
5.6.50.0030.01414.33
5.6.40.0040.00714.09
5.6.30.0110.00314.33
5.6.20.0090.00614.14
5.6.10.0040.01114.20
5.6.00.0060.00314.20
5.5.380.0120.00011.18
5.5.370.0040.00711.40
5.5.360.0030.00611.42
5.5.350.0080.02215.80
5.5.340.0140.02814.62
5.5.330.0060.04015.76
5.5.320.0280.03815.77
5.5.310.0100.03115.78
5.5.300.0070.02014.63
5.5.290.0040.02414.55
5.5.280.0030.02716.03
5.5.270.0070.04316.02
5.5.260.0050.04816.03
5.5.250.0060.04015.88
5.5.240.0150.01615.73
5.5.230.0030.00911.18
5.5.220.0030.01011.18
5.5.210.0120.00011.18
5.5.200.0030.00711.18
5.5.190.0030.01011.18
5.5.180.0070.00311.18
5.5.170.0070.00411.18
5.5.160.0080.00411.18
5.5.150.0070.00011.18
5.5.140.0040.00411.18
5.5.130.0000.00711.18
5.5.120.0060.00311.18
5.5.110.0030.00611.18
5.5.100.0070.00311.18
5.5.90.0030.00611.18
5.5.80.0030.00611.18
5.5.70.0000.00611.18
5.5.60.0040.00411.18
5.5.50.0030.00611.18
5.5.40.0070.00411.18
5.5.30.0080.00411.18
5.5.20.0040.00411.20
5.5.10.0000.00911.18
5.5.00.0060.00311.18
5.4.450.0370.03215.32
5.4.440.0300.03415.32
5.4.430.0100.02815.23
5.4.420.0350.03515.27
5.4.410.0400.02815.10
5.4.400.0400.03215.09
5.4.390.0470.03015.21
5.4.380.0170.02714.98
5.4.370.0080.03314.90
5.4.360.0270.02514.90
5.4.350.0130.03014.96
5.4.340.0170.02814.94
5.4.330.0040.00711.18
5.4.320.0040.02111.84
5.4.310.0020.02611.84
5.4.300.0070.02411.84
5.4.290.0130.03211.83
5.4.280.0080.02511.78
5.4.270.0080.03511.78
5.4.260.0090.02511.78
5.4.250.0060.02511.78
5.4.240.0070.01911.78
5.4.230.0070.02011.78
5.4.220.0020.02711.78
5.4.210.0070.02711.78
5.4.200.0070.02311.77
5.4.190.0080.02211.78
5.4.180.0050.02611.77
5.4.170.0080.01911.78
5.4.160.0100.03811.78
5.4.150.0040.03411.77
5.4.140.0080.02711.62
5.4.130.0040.02811.61
5.4.120.0070.02511.59
5.4.110.0060.02111.59
5.4.100.0050.02311.59
5.4.90.0050.02411.59
5.4.80.0070.02111.59
5.4.70.0070.01911.59
5.4.60.0070.02611.59
5.4.50.0080.02611.59
5.4.40.0080.02411.58
5.4.30.0070.02511.58
5.4.20.0070.02611.58
5.4.10.0080.02511.58
5.4.00.0050.02811.33
5.3.290.0060.02311.99
5.3.280.0080.03311.94
5.3.270.0070.03011.95
5.3.260.0040.03911.95
5.3.250.0070.02711.95
5.3.240.0050.02211.95
5.3.230.0070.02711.94
5.3.220.0030.02411.93
5.3.210.0050.02311.93
5.3.200.0070.02211.93
5.3.190.0050.02211.92
5.3.180.0040.02611.92
5.3.170.0090.02311.92
5.3.160.0050.02211.92
5.3.150.0060.02111.92
5.3.140.0070.02111.92
5.3.130.0070.02611.92
5.3.120.0060.02611.92
5.3.110.0070.02911.92
5.3.100.0040.02311.65
5.3.90.0080.02111.64
5.3.80.0050.02311.64
5.3.70.0060.02211.64
5.3.60.0020.02211.63
5.3.50.0030.02311.61
5.3.40.0040.02111.61
5.3.30.0030.02111.59
5.3.20.0050.02011.48
5.3.10.0020.02211.46
5.3.00.0090.01811.45
5.2.170.0040.02110.20
5.2.160.0030.01810.20
5.2.150.0020.01810.20
5.2.140.0030.01910.20
5.2.130.0040.01810.18
5.2.120.0030.01810.18
5.2.110.0030.02310.19
5.2.100.0050.01610.19
5.2.90.0060.01610.18
5.2.80.0090.01310.18
5.2.70.0040.01910.18
5.2.60.0050.02610.16
5.2.50.0030.01810.14
5.2.40.0040.01710.13
5.2.30.0020.02110.12
5.2.20.0050.02110.11
5.2.10.0010.03810.07
5.2.00.0030.02510.00
5.1.60.0030.0189.64
5.1.50.0090.0229.64
5.1.40.0050.0259.63
5.1.30.0040.0219.80
5.1.20.0040.0219.81
5.1.10.0050.0149.67
5.1.00.0040.0179.68
5.0.50.0010.0168.91
5.0.40.0040.0108.84
5.0.30.0030.0178.75
5.0.20.0040.0118.73
5.0.10.0050.0098.73
5.0.00.0040.0168.72
4.4.90.0030.0117.98
4.4.80.0060.0107.96
4.4.70.0010.0127.96
4.4.60.0020.0107.97
4.4.50.0030.0107.97
4.4.40.0020.0157.94
4.4.30.0030.0097.97
4.4.20.0040.0088.01
4.4.10.0030.0108.01
4.4.00.0020.0157.97
4.3.110.0020.0117.92
4.3.100.0010.0117.92
4.3.90.0040.0087.90
4.3.80.0030.0147.88
4.3.70.0010.0137.90
4.3.60.0020.0127.90
4.3.50.0020.0147.90
4.3.40.0020.0167.86
4.3.30.0020.0127.24
4.3.20.0030.0107.23
4.3.10.0010.0117.21
4.3.00.0130.00910.86

preferences:
42.54 ms | 401 KiB | 5 Q