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(), 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.40.0120.00418.88
8.3.30.0070.01419.04
8.3.20.0040.00420.33
8.3.10.0070.01023.65
8.3.00.0090.00019.38
8.2.170.0110.00422.96
8.2.160.0160.00320.60
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00726.16
8.2.120.0060.00322.27
8.2.110.0030.00622.11
8.2.100.0080.00317.78
8.2.90.0080.00019.05
8.2.80.0000.00817.97
8.2.70.0060.00317.25
8.2.60.0030.00617.80
8.2.50.0090.00019.20
8.2.40.0050.00319.95
8.2.30.0060.00317.89
8.2.20.0060.00317.70
8.2.10.0000.00717.95
8.2.00.0060.00317.75
8.1.270.0040.00423.79
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0080.00023.91
8.1.230.0040.00819.16
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00617.48
8.1.190.0080.00017.53
8.1.180.0000.00918.10
8.1.170.0040.00418.50
8.1.160.0050.00222.10
8.1.150.0070.00418.65
8.1.140.0030.00617.36
8.1.130.0030.00317.34
8.1.120.0000.00717.41
8.1.110.0040.00417.41
8.1.100.0040.00417.50
8.1.90.0030.00517.37
8.1.80.0000.00717.32
8.1.70.0030.00317.47
8.1.60.0040.00417.68
8.1.50.0030.00517.53
8.1.40.0000.00817.53
8.1.30.0050.00317.56
8.1.20.0040.00417.56
8.1.10.0000.00717.52
8.1.00.0040.00417.55
8.0.300.0040.00418.89
8.0.290.0060.00317.05
8.0.280.0030.00318.31
8.0.270.0030.00317.15
8.0.260.0030.00316.90
8.0.250.0070.00016.96
8.0.240.0030.00617.00
8.0.230.0070.00016.93
8.0.220.0030.00516.94
8.0.210.0040.00416.92
8.0.200.0000.00716.99
8.0.190.0030.00517.00
8.0.180.0020.00616.96
8.0.170.0040.00416.89
8.0.160.0050.00216.86
8.0.150.0000.00716.90
8.0.140.0040.00416.82
8.0.130.0060.00313.37
8.0.120.0000.00916.94
8.0.110.0000.00816.98
8.0.100.0000.00716.89
8.0.90.0080.00016.96
8.0.80.0060.01016.95
8.0.70.0040.00416.82
8.0.60.0000.00817.04
8.0.50.0000.00816.81
8.0.30.0120.00717.05
8.0.20.0140.00617.40
8.0.10.0040.00416.95
8.0.00.0100.01216.86
7.4.330.0020.00215.00
7.4.320.0000.00716.60
7.4.300.0000.00616.59
7.4.290.0000.00716.42
7.4.280.0000.00716.37
7.4.270.0030.00316.51
7.4.260.0030.00316.60
7.4.250.0080.00016.63
7.4.240.0030.00316.65
7.4.230.0000.00716.52
7.4.220.0110.00716.58
7.4.210.0080.01016.64
7.4.200.0040.00416.45
7.4.190.0040.00416.77
7.4.160.0080.00816.61
7.4.150.0110.00717.40
7.4.140.0140.00717.86
7.4.130.0030.01316.47
7.4.120.0080.01016.59
7.4.110.0100.00716.51
7.4.100.0060.01216.39
7.4.90.0000.01716.38
7.4.80.0140.00919.39
7.4.70.0070.01716.71
7.4.60.0120.00616.40
7.4.50.0080.00016.45
7.4.40.0030.01322.77
7.4.30.0070.01116.57
7.4.10.0070.00714.74
7.4.00.0080.00815.11
7.3.330.0060.00013.38
7.3.320.0000.00513.13
7.3.310.0000.00716.23
7.3.300.0050.00416.38
7.3.290.0110.00316.30
7.3.280.0070.00916.36
7.3.270.0100.00717.40
7.3.260.0100.00716.41
7.3.250.0170.00316.46
7.3.240.0110.00616.34
7.3.230.0150.00016.46
7.3.210.0130.01016.38
7.3.200.0030.01819.39
7.3.190.0120.00616.61
7.3.180.0080.00816.60
7.3.170.0030.01216.41
7.3.160.0120.00316.28
7.3.130.0030.01614.98
7.3.120.0060.00814.92
7.3.110.0140.00414.90
7.3.100.0070.01014.90
7.3.90.0080.00414.68
7.3.80.0110.00315.04
7.3.70.0040.01214.80
7.3.60.0070.00714.91
7.3.50.0070.00314.91
7.3.40.0070.00714.54
7.3.30.0040.01114.74
7.3.20.0070.00716.40
7.3.10.0050.00816.57
7.3.00.0060.00716.70
7.2.330.0100.00716.46
7.2.320.0060.01116.72
7.2.310.0070.01016.77
7.2.300.0100.01316.72
7.2.290.0030.01316.59
7.2.260.0110.00714.70
7.2.250.0040.01515.16
7.2.240.0070.00715.12
7.2.230.0060.01015.26
7.2.220.0000.01515.16
7.2.210.0090.00615.32
7.2.200.0030.01015.07
7.2.190.0090.00615.08
7.2.180.0090.00015.08
7.2.170.0070.00315.17
7.2.160.0030.01215.04
7.2.150.0000.01017.07
7.2.140.0090.00616.95
7.2.130.0070.00816.80
7.2.120.0030.00916.68
7.2.110.0050.00816.76
7.2.100.0040.01116.95
7.2.90.0070.00816.89
7.2.80.0060.00916.87
7.2.70.0060.00716.93
7.2.60.0050.00816.94
7.2.50.0060.01016.85
7.2.40.0050.00816.98
7.2.30.0050.00616.81
7.2.20.0040.01016.86
7.2.10.0080.00516.72
7.2.00.0080.00817.35
7.1.330.0090.00615.73
7.1.320.0070.00715.86
7.1.310.0030.01015.82
7.1.300.0120.00416.00
7.1.290.0090.00315.69
7.1.280.0060.00915.82
7.1.270.0040.01115.71
7.1.260.0040.01115.62
7.1.250.0050.00815.68
7.1.240.0110.00415.82
7.1.230.0120.00315.71
7.1.220.0060.00615.47
7.1.210.0030.00915.60
7.1.200.0090.00515.63
7.1.190.0000.01315.55
7.1.180.0050.00515.34
7.1.170.0030.01315.91
7.1.160.0040.00815.64
7.1.150.0040.01115.69
7.1.140.0030.01015.79
7.1.130.0130.00015.68
7.1.120.0060.00915.74
7.1.110.0100.00315.62
7.1.100.0000.01516.91
7.1.90.0040.00815.41
7.1.80.0090.00615.80
7.1.70.0020.01016.27
7.1.60.0090.00717.71
7.1.50.0090.00816.48
7.1.40.0030.01515.81
7.1.30.0070.01015.39
7.1.20.0030.01115.64
7.1.10.0030.01015.65
7.1.00.0020.04518.98
7.0.330.0060.00315.39
7.0.320.0100.00315.49
7.0.310.0060.00315.48
7.0.300.0070.01015.15
7.0.290.0030.00615.12
7.0.280.0060.00615.48
7.0.270.0080.00315.55
7.0.260.0060.00615.05
7.0.250.0070.00715.12
7.0.240.0070.00715.50
7.0.230.0110.00415.44
7.0.220.0110.00315.40
7.0.210.0030.00715.41
7.0.200.0000.00916.12
7.0.190.0070.00715.39
7.0.180.0030.00715.50
7.0.170.0060.00915.47
7.0.160.0060.00615.33
7.0.150.0070.00715.14
7.0.140.0020.04118.75
7.0.130.0030.00615.36
7.0.120.0080.00815.31
7.0.110.0000.00815.43
7.0.100.0120.00015.57
7.0.90.0100.00315.31
7.0.80.0100.00315.57
7.0.70.0060.00615.17
7.0.60.0030.05017.71
7.0.50.0040.03916.65
7.0.40.0030.04416.75
7.0.30.0210.03316.79
7.0.20.0150.02816.82
7.0.10.0070.03216.83
7.0.00.0020.03216.79
5.6.400.0100.00714.15
5.6.390.0080.00413.99
5.6.380.0030.00714.71
5.6.370.0100.00014.32
5.6.360.0030.01414.18
5.6.350.0140.00014.18
5.6.340.0000.00914.54
5.6.330.0030.01114.73
5.6.320.0000.01314.53
5.6.310.0000.01314.55
5.6.300.0060.00914.44
5.6.290.0030.01014.13
5.6.280.0050.03817.67
5.6.270.0030.01214.32
5.6.260.0070.00714.58
5.6.250.0060.00814.28
5.6.240.0040.01114.27
5.6.230.0060.00314.48
5.6.220.0070.00714.33
5.6.210.0070.04817.42
5.6.200.0050.03016.44
5.6.190.0030.03517.42
5.6.180.0170.02217.43
5.6.170.0130.03117.41
5.6.160.0070.04117.37
5.6.150.0120.03916.20
5.6.140.0020.02516.28
5.6.130.0070.03416.19
5.6.120.0120.03717.62
5.6.110.0080.04117.80
5.6.100.0070.02717.73
5.6.90.0020.04317.66
5.6.80.0100.03817.25
5.6.70.2250.02817.18
5.6.60.0080.00614.04
5.6.50.0080.00414.32
5.6.40.0070.00714.30
5.6.30.0000.00914.21
5.6.20.0070.00314.54
5.6.10.0000.01214.22
5.6.00.0030.01014.29
5.5.380.0060.00614.57
5.5.370.0040.01114.03
5.5.360.0060.00314.49
5.5.350.0130.04517.19
5.5.340.0050.02816.18
5.5.330.0050.03117.25
5.5.320.0200.03217.46
5.5.310.0240.03717.13
5.5.300.0080.04316.13
5.5.290.0080.04416.23
5.5.280.0000.02817.58
5.5.270.0060.02317.61
5.5.260.0090.03817.40
5.5.250.0030.02317.37
5.5.240.0190.03717.31
5.5.230.0100.00714.11
5.5.220.0070.00714.20
5.5.210.0030.01314.34
5.5.200.0080.00314.04
5.5.190.0030.00714.14
5.5.180.0060.00614.39
5.5.170.0030.01114.32
5.5.160.0100.00314.30
5.5.150.0040.00413.96
5.5.140.0060.00614.25
5.5.130.0040.00714.10
5.5.120.0030.00914.27
5.5.110.0000.01513.87
5.5.100.0040.01114.09
5.5.90.0000.01314.25
5.5.80.0000.01414.09
5.5.70.0000.01014.26
5.5.60.0090.00914.34
5.5.50.0040.00813.99
5.5.40.0050.00514.03
5.5.30.0060.00614.18
5.5.20.0060.00614.28
5.5.10.0100.00014.19
5.5.00.0070.00714.24
5.4.450.0400.03415.08
5.4.440.0460.03315.15
5.4.430.0350.03015.04
5.4.420.0420.02815.21
5.4.410.0450.03214.96
5.4.400.0440.03215.11
5.4.390.0430.03514.90
5.4.380.0220.02714.83
5.4.370.0200.03514.89
5.4.360.0130.03114.81
5.4.350.0100.03314.68
5.4.340.0230.03014.76
5.4.330.0090.00310.94
5.4.320.0060.02011.75
5.4.310.0040.02511.78
5.4.300.0040.02411.72
5.4.290.0040.02311.71
5.4.280.0040.02711.72
5.4.270.0070.02011.49
5.4.260.0020.02411.65
5.4.250.0040.02511.63
5.4.240.0100.01711.58
5.4.230.0030.02411.62
5.4.220.0040.02411.47
5.4.210.0070.02511.61
5.4.200.0080.02711.74
5.4.190.0040.02811.63
5.4.180.0040.03011.76
5.4.170.0090.02811.66
5.4.160.0100.02611.63
5.4.150.0030.02311.53
5.4.140.0070.06211.55
5.4.130.0090.02411.53
5.4.120.0050.02711.50
5.4.110.0130.03411.45
5.4.100.0050.02711.42
5.4.90.0070.02411.37
5.4.80.0040.02311.58
5.4.70.0030.02311.56
5.4.60.0050.02311.50
5.4.50.0050.02111.39
5.4.40.0040.02711.53
5.4.30.0040.02311.54
5.4.20.0070.03011.55
5.4.10.0020.02511.55
5.4.00.0070.02711.29
5.3.290.0040.02411.60
5.3.280.0060.02311.65
5.3.270.0080.03811.59
5.3.260.0170.04511.65
5.3.250.0070.03211.68
5.3.240.0100.04111.49
5.3.230.0050.03011.64
5.3.220.0050.02511.53
5.3.210.0070.02611.61
5.3.200.0040.02911.45
5.3.190.0090.03211.65
5.3.180.0060.03211.70
5.3.170.0070.02911.68
5.3.160.0050.03111.57
5.3.150.0090.03011.70
5.3.140.0070.02911.66
5.3.130.0040.03111.62
5.3.120.0080.03011.53
5.3.110.0070.03011.53
5.3.100.0080.02811.35
5.3.90.0040.02511.25
5.3.80.0050.02211.36
5.3.70.0060.02011.16
5.3.60.0020.02711.33
5.3.50.0040.02511.28
5.3.40.0050.02311.35
5.3.30.0040.02611.26
5.3.20.0070.02211.13
5.3.10.0060.02311.02
5.3.00.0070.02211.02
5.2.170.0060.0399.23
5.2.160.0210.0619.23
5.2.150.0110.0339.23
5.2.140.0100.0309.23
5.2.130.0100.0369.19
5.2.120.0090.0409.19
5.2.110.0120.0539.20
5.2.100.0070.0379.19
5.2.90.0110.0379.20
5.2.80.0070.0399.19
5.2.70.0060.0339.19
5.2.60.0070.0569.14
5.2.50.0100.0399.11
5.2.40.0080.0309.09
5.2.30.0040.0369.06
5.2.20.0090.0289.05
5.2.10.0090.0408.96
5.2.00.0110.0678.82
5.1.60.0070.0358.10
5.1.50.0070.0368.09
5.1.40.0130.0488.08
5.1.30.0040.0348.43
5.1.20.0240.0908.45
5.1.10.0080.0278.17
5.1.00.0090.0368.18
5.0.50.0130.0276.66
5.0.40.0160.0516.52
5.0.30.0090.0366.33
5.0.20.0040.0276.30
5.0.10.0040.0256.27
5.0.00.0080.0356.26
4.4.90.0070.0284.77
4.4.80.0030.0164.75
4.4.70.0050.0164.75
4.4.60.0070.0204.75
4.4.50.0040.0204.77
4.4.40.0060.0294.71
4.4.30.0040.0214.75
4.4.20.0050.0254.85
4.4.10.0080.0204.85
4.4.00.0020.0374.75
4.3.110.0080.0344.67
4.3.100.0070.0224.66
4.3.90.0040.0214.64
4.3.80.0020.0294.59
4.3.70.0030.0164.63
4.3.60.0060.0194.62
4.3.50.0040.0224.63
4.3.40.0030.0264.54
4.3.30.0020.0173.30
4.3.20.0040.0153.28
4.3.10.0030.0163.24
4.3.00.0100.02010.54

preferences:
49.49 ms | 400 KiB | 5 Q