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 { } $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.0000.01516.75
8.3.50.0070.01122.09
8.3.40.0100.00718.71
8.3.30.0150.00619.04
8.3.20.0060.00320.21
8.3.10.0030.00623.56
8.3.00.0090.00019.38
8.2.180.0070.00718.29
8.2.170.0070.00722.96
8.2.160.0060.00918.66
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0090.00026.16
8.2.120.0080.00022.02
8.2.110.0100.00021.99
8.2.100.0030.00917.78
8.2.90.0030.00519.22
8.2.80.0080.00017.97
8.2.70.0090.00017.63
8.2.60.0030.00617.79
8.2.50.0100.00018.07
8.2.40.0040.00419.81
8.2.30.0040.00417.88
8.2.20.0040.00417.75
8.2.10.0040.00419.91
8.2.00.0030.00517.75
8.1.280.0030.01625.92
8.1.270.0090.00023.88
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.70
8.1.230.0070.00419.00
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0080.00017.50
8.1.180.0040.00418.10
8.1.170.0060.00318.65
8.1.160.0000.00822.09
8.1.150.0020.00718.66
8.1.140.0000.00817.34
8.1.130.0000.00717.85
8.1.120.0000.00717.47
8.1.110.0000.00817.46
8.1.100.0000.00717.50
8.1.90.0040.00417.30
8.1.80.0030.00517.36
8.1.70.0070.00017.44
8.1.60.0040.00417.61
8.1.50.0040.00417.57
8.1.40.0000.00817.54
8.1.30.0040.00417.66
8.1.20.0000.00717.65
8.1.10.0070.00317.46
8.1.00.0060.00317.54
8.0.300.0080.00019.10
8.0.290.0070.00017.16
8.0.280.0030.00318.36
8.0.270.0040.00417.13
8.0.260.0040.00417.07
8.0.250.0000.00716.86
8.0.240.0040.00417.02
8.0.230.0030.00316.99
8.0.220.0000.00716.77
8.0.210.0040.00416.92
8.0.200.0030.00316.95
8.0.190.0000.00716.95
8.0.180.0000.01016.93
8.0.170.0060.00316.95
8.0.160.0000.00716.80
8.0.150.0040.00416.81
8.0.140.0070.00016.80
8.0.130.0000.00713.38
8.0.120.0050.00316.96
8.0.110.0050.00316.97
8.0.100.0000.00716.89
8.0.90.0000.00716.84
8.0.80.0060.00916.94
8.0.70.0040.00417.01
8.0.60.0030.00616.88
8.0.50.0040.00416.91
8.0.30.0110.00717.10
8.0.20.0110.00817.40
8.0.10.0030.00517.15
8.0.00.0060.01316.54
7.4.330.0020.00215.00
7.4.320.0030.00316.48
7.4.300.0000.00616.56
7.4.290.0000.00716.60
7.4.280.0070.00016.52
7.4.270.0000.00816.65
7.4.260.0030.00516.62
7.4.250.0050.00316.58
7.4.240.0030.00516.64
7.4.230.0070.00016.66
7.4.220.0130.00616.57
7.4.210.0070.00716.65
7.4.200.0030.00316.72
7.4.190.0000.00716.57
7.4.160.0150.00016.55
7.4.150.0040.01517.40
7.4.140.0110.00917.86
7.4.130.0070.01016.63
7.4.120.0150.00616.59
7.4.110.0040.01316.41
7.4.100.0110.00916.40
7.4.90.0090.01516.50
7.4.80.0050.01719.39
7.4.70.0170.00016.66
7.4.60.0060.01616.51
7.4.50.0030.00316.30
7.4.40.0080.00722.77
7.4.30.0070.01116.39
7.4.00.0090.00614.71
7.3.330.0030.00313.22
7.3.320.0050.00013.30
7.3.310.0030.00316.38
7.3.300.0030.00516.22
7.3.290.0110.00316.41
7.3.280.0110.00816.36
7.3.270.0100.00717.40
7.3.260.0090.00916.52
7.3.250.0080.01316.42
7.3.240.0090.00916.59
7.3.230.0110.00616.43
7.3.210.0070.01616.41
7.3.200.0140.00419.39
7.3.190.0100.00716.48
7.3.180.0030.01216.60
7.3.170.0060.01216.38
7.3.160.0110.00616.55
7.3.120.0050.00514.91
7.2.330.0150.00616.38
7.2.320.0060.01016.41
7.2.310.0030.01416.54
7.2.300.0100.01016.66
7.2.290.0070.01016.71
7.2.60.0130.00316.62
7.2.00.0000.01619.42
7.1.200.0030.01015.67
7.1.100.0040.00418.13
7.1.70.0040.00417.05
7.1.60.0070.01719.46
7.1.50.0100.01316.70
7.1.00.0030.07722.40
7.0.200.0070.00316.58
7.0.140.0030.07322.11
7.0.60.0070.08319.95
7.0.50.0030.04017.88
7.0.40.0070.04720.40
7.0.30.0370.06720.15
7.0.20.0270.08320.23
7.0.10.0070.09020.07
7.0.00.0070.08020.08
5.6.280.0070.07021.11
5.6.210.0130.07320.50
5.6.200.0030.04018.18
5.6.190.0170.07720.47
5.6.180.0300.08320.67
5.6.170.0170.06320.57
5.6.160.0100.04020.48
5.6.150.0030.04318.18
5.6.140.0030.08018.27
5.6.130.0100.06018.15
5.6.120.0030.05721.11
5.6.110.0070.07320.99
5.6.100.0000.04321.09
5.6.90.0000.04321.02
5.6.80.0000.04320.51
5.6.70.4370.03320.35
5.5.350.0200.08020.53
5.5.340.0100.07317.93
5.5.330.0070.05720.57
5.5.320.0230.03720.36
5.5.310.0430.07320.27
5.5.300.0100.07718.08
5.5.290.0100.04018.07
5.5.280.0130.08020.77
5.5.270.0200.07720.77
5.5.260.0100.08720.64
5.5.250.0100.07720.71
5.5.240.0230.05320.27
5.4.450.0530.07319.16
5.4.440.0870.05019.37
5.4.430.1000.06019.37
5.4.420.0700.05719.15
5.4.410.0000.06319.40
5.4.400.0830.05019.16
5.4.390.0930.06319.24
5.4.380.0300.06318.77
5.4.370.0270.05718.76
5.4.360.0370.04318.61
5.4.350.0270.05718.56
5.4.340.0400.04318.54
5.4.320.0030.03812.50
5.4.310.0110.03612.50
5.4.300.0060.03712.50
5.4.290.0120.05112.48
5.4.280.0160.07412.38
5.4.270.0060.04212.39
5.4.260.0070.04212.38
5.4.250.0090.03712.39
5.4.240.0050.04412.39
5.4.230.0060.04412.37
5.4.220.0090.03812.38
5.4.210.0090.05112.38
5.4.200.0080.04312.38
5.4.190.0090.03912.37
5.4.180.0080.04512.38
5.4.170.0060.04812.38
5.4.160.0060.04212.38
5.4.150.0100.03912.37
5.4.140.0070.04712.06
5.4.130.0160.06212.05
5.4.120.0120.04512.00
5.4.110.0210.09312.00
5.4.100.0180.07712.00
5.4.90.0110.07712.00
5.4.80.0140.07412.00
5.4.70.0080.07112.00
5.4.60.0210.07411.99
5.4.50.0230.09812.00
5.4.40.0100.07111.98
5.4.30.0090.05111.98
5.4.20.0290.12311.98
5.4.10.0080.04711.98
5.4.00.0120.07011.48
5.3.290.0060.04012.80
5.3.280.0150.05412.71
5.3.270.0070.05312.73
5.3.260.0100.08812.72
5.3.250.0100.06112.72
5.3.240.0230.08212.72
5.3.230.0220.09112.71
5.3.220.0130.07712.68
5.3.210.0100.09412.68
5.3.200.0140.07112.68
5.3.190.0060.08012.68
5.3.180.0120.08612.68
5.3.170.0160.06112.67
5.3.160.0140.06312.67
5.3.150.0100.08712.67
5.3.140.0160.08512.66
5.3.130.0160.09512.66
5.3.120.0130.08412.66
5.3.110.0170.07512.66
5.3.100.0140.06612.13
5.3.90.0190.09912.11
5.3.80.0190.08312.09
5.3.70.0110.08712.09
5.3.60.0130.09612.08
5.3.50.0160.06212.03
5.3.40.0200.09712.03
5.3.30.0200.06111.99
5.3.20.0040.06611.77
5.3.10.0080.05111.73
5.3.00.0140.09011.72
5.2.170.0170.0769.22
5.2.160.0160.0869.22
5.2.150.0040.0429.22
5.2.140.0100.0389.22
5.2.130.0100.0579.18
5.2.120.0070.0409.18
5.2.110.0050.0429.19
5.2.100.0060.0449.19
5.2.90.0090.0469.19
5.2.80.0050.0499.18
5.2.70.0060.0449.18
5.2.60.0080.0319.13
5.2.50.0090.0319.10
5.2.40.0080.0319.07
5.2.30.0060.0419.06
5.2.20.0070.0389.04
5.2.10.0070.0308.95
5.2.00.0040.0328.81
5.1.60.0070.0228.09
5.1.50.0080.0278.09
5.1.40.0040.0298.07
5.1.30.0070.0298.43
5.1.20.0090.0428.45
5.1.10.0070.0408.16
5.1.00.0150.0458.16
5.0.50.0020.0296.65
5.0.40.0050.0276.50
5.0.30.0040.0866.32
5.0.20.0060.0206.29
5.0.10.0100.0256.26
5.0.00.0070.0486.25
4.4.90.0060.0234.78
4.4.80.0080.0234.75
4.4.70.0060.0154.75
4.4.60.0040.0204.75
4.4.50.0120.0354.77
4.4.40.0070.0344.71
4.4.30.0030.0264.76
4.4.20.0090.0304.84
4.4.10.0040.0264.85
4.4.00.0030.0394.76
4.3.110.0030.0214.67
4.3.100.0080.0204.67
4.3.90.0160.0384.63
4.3.80.0190.0734.59
4.3.70.0080.0364.63
4.3.60.0150.0474.63
4.3.50.0030.0214.63
4.3.40.0030.0494.54
4.3.30.0030.0203.30
4.3.20.0020.0213.28
4.3.10.0050.0183.24
4.3.00.0270.02710.54

preferences:
46.74 ms | 401 KiB | 5 Q