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{ public function getAnswer($question) { var_dump($question); } } $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.60.0140.00718.55
8.3.50.0190.00321.14
8.3.40.0080.00818.76
8.3.30.0060.01019.04
8.3.20.0050.00320.33
8.3.10.0160.00622.04
8.3.00.0040.00422.39
8.2.180.0150.00016.75
8.2.170.0150.00022.96
8.2.160.0100.00320.35
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0100.00726.16
8.2.120.0150.00019.23
8.2.110.0090.00021.88
8.2.100.0100.00317.91
8.2.90.0060.00319.28
8.2.80.0080.00018.05
8.2.70.0040.00417.50
8.2.60.0000.00717.80
8.2.50.0000.01118.07
8.2.40.0060.00318.20
8.2.30.0040.00417.88
8.2.20.0090.00017.32
8.2.10.0090.00019.57
8.2.00.0030.00517.83
8.1.280.0100.01025.92
8.1.270.0070.00023.99
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00023.73
8.1.230.0070.00419.10
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.54
8.1.180.0000.00818.10
8.1.170.0060.00318.64
8.1.160.0090.00022.00
8.1.150.0000.00718.52
8.1.140.0030.00517.45
8.1.130.0030.00317.90
8.1.120.0000.00717.35
8.1.110.0060.00317.48
8.1.100.0030.00317.39
8.1.90.0040.00417.42
8.1.80.0030.00317.46
8.1.70.0030.00317.32
8.1.60.0080.00017.56
8.1.50.0040.00417.44
8.1.40.0040.00417.56
8.1.30.0000.00717.65
8.1.20.0040.00417.66
8.1.10.0000.00817.59
8.1.00.0040.00417.40
8.0.300.0080.00318.77
8.0.290.0040.00417.03
8.0.280.0070.00018.37
8.0.270.0000.00817.16
8.0.260.0030.00316.81
8.0.250.0030.00316.98
8.0.240.0030.00616.86
8.0.230.0000.00716.94
8.0.220.0030.00316.94
8.0.210.0000.00616.91
8.0.200.0000.00716.95
8.0.190.0070.00016.89
8.0.180.0000.00716.94
8.0.170.0040.00416.95
8.0.160.0000.00716.77
8.0.150.0030.00316.89
8.0.140.0050.00316.93
8.0.130.0000.00513.36
8.0.120.0050.00216.82
8.0.110.0040.00416.91
8.0.100.0000.00716.99
8.0.90.0000.00716.91
8.0.80.0130.00316.91
8.0.70.0000.00717.00
8.0.60.0040.00416.74
8.0.50.0040.00417.02
8.0.30.0130.00917.04
8.0.20.0070.01117.40
8.0.10.0050.00316.88
8.0.00.0090.00916.66
7.4.330.0000.00615.13
7.4.320.0060.00016.61
7.4.300.0000.00716.58
7.4.290.0040.00416.45
7.4.280.0030.00316.60
7.4.270.0070.00016.50
7.4.260.0030.00316.48
7.4.250.0000.00716.45
7.4.240.0020.00516.52
7.4.230.0030.00316.67
7.4.220.0090.00916.54
7.4.210.0060.00816.55
7.4.200.0000.00716.63
7.4.190.0000.00716.63
7.4.160.0060.00916.70
7.4.150.0140.00717.40
7.4.140.0120.00617.86
7.4.130.0110.00616.43
7.4.120.0110.00616.53
7.4.110.0130.00316.63
7.4.100.0130.00716.47
7.4.90.0080.00816.61
7.4.80.0080.01119.39
7.4.70.0130.00316.75
7.4.60.0060.01016.50
7.4.50.0000.00516.62
7.4.40.0090.00422.77
7.4.30.0130.00316.21
7.4.00.0100.00714.95
7.3.330.0050.00013.30
7.3.320.0000.00513.36
7.3.310.0000.00716.47
7.3.300.0000.00716.31
7.3.290.0030.01216.35
7.3.280.0080.01016.34
7.3.270.0100.01317.40
7.3.260.0140.00316.33
7.3.250.0130.00716.48
7.3.240.0120.00316.30
7.3.230.0030.01416.47
7.3.210.0100.00616.50
7.3.200.0120.00319.39
7.3.190.0110.01116.40
7.3.180.0090.00616.52
7.3.170.0110.00716.32
7.3.160.0120.00316.55
7.3.120.0070.01014.90
7.3.110.0030.01314.59
7.3.100.0040.00815.00
7.3.90.0060.00914.87
7.3.80.0110.00314.78
7.3.70.0070.00714.89
7.3.60.0040.00714.62
7.3.50.0000.01314.80
7.3.40.0090.00614.89
7.3.30.0060.00614.79
7.3.20.0060.00916.70
7.3.10.0110.00416.62
7.3.00.0080.00016.21
7.2.330.0340.02116.63
7.2.320.0060.01316.58
7.2.310.0030.01416.36
7.2.300.0060.01216.64
7.2.290.0090.01316.63
7.2.250.0040.01415.17
7.2.240.0060.01215.21
7.2.230.0070.01015.14
7.2.220.0110.00715.11
7.2.210.0030.01014.98
7.2.200.0100.00714.81
7.2.190.0040.01115.05
7.2.180.0090.00914.86
7.2.170.0130.00314.86
7.2.60.0100.00316.99
7.2.00.0000.01219.04
7.1.330.0030.00915.77
7.1.320.0000.00815.62
7.1.310.0040.00815.83
7.1.300.0030.01015.82
7.1.290.0110.00715.57
7.1.280.0030.01515.67
7.1.270.0040.00815.70
7.1.260.0030.00615.77
7.1.200.0120.00015.78
7.1.100.0030.00618.21
7.1.70.0030.00517.02
7.1.60.0180.00719.82
7.1.50.0070.01416.75
7.1.00.0030.07322.35
7.0.200.0000.00816.88
7.0.140.0100.06722.21
7.0.60.0070.07720.02
7.0.50.0030.04017.72
7.0.40.0100.08320.06
7.0.30.0270.07720.23
7.0.20.0170.04320.26
7.0.10.0230.07320.24
7.0.00.0070.04020.05
5.6.280.0030.06720.79
5.6.210.0070.05320.71
5.6.200.0030.05018.23
5.6.190.0070.07320.61
5.6.180.4030.04020.58
5.6.170.0200.04320.54
5.6.160.0030.06020.52
5.6.150.0030.08718.18
5.6.140.0000.05018.28
5.6.130.0030.08718.11
5.6.120.0170.03320.97
5.6.110.0100.06320.97
5.6.100.0170.08021.12
5.6.90.0000.08720.99
5.6.80.0200.07320.41
5.6.70.0330.06720.38
5.5.350.0030.08320.39
5.5.340.0100.06017.98
5.5.330.0170.07320.40
5.5.320.0200.05720.38
5.5.310.0170.06720.27
5.5.300.0070.03318.09
5.5.290.0030.04318.00
5.5.280.0100.07320.97
5.5.270.0100.04720.98
5.5.260.0000.08720.82
5.5.250.0230.05720.71
5.5.240.0170.06320.17
5.4.450.0630.05319.13
5.4.440.0000.06319.55
5.4.430.0130.05319.47
5.4.420.0100.05719.52
5.4.410.0100.05319.41
5.4.400.0800.00018.77
5.4.390.0800.00018.57
5.4.380.0300.07718.75
5.4.370.0200.05018.78
5.4.360.0270.05318.59
5.4.350.0130.05718.57
5.4.340.0270.05318.77
5.4.320.0130.03712.51
5.4.310.0110.03912.50
5.4.300.0070.04412.50
5.4.290.0050.03912.50
5.4.280.0080.03612.39
5.4.270.0170.06318.79
5.4.260.0170.07018.93
5.4.250.0100.05719.02
5.4.240.0100.05719.00
5.4.230.0030.06318.89
5.4.220.0100.05318.92
5.4.210.0100.07018.88
5.4.200.0200.06319.01
5.4.190.0130.05018.93
5.4.180.0170.06018.73
5.4.170.0130.05318.98
5.4.160.0170.07018.61
5.4.150.0070.06018.71
5.4.140.0130.04716.36
5.4.130.0200.04716.50
5.4.120.0070.05316.41
5.4.110.0130.07016.60
5.4.100.0100.05016.52
5.4.90.0070.05316.32
5.4.80.0030.06716.44
5.4.70.0200.06316.61
5.4.60.0100.04716.38
5.4.50.0030.05716.61
5.4.40.0170.05316.34
5.4.30.0170.05716.34
5.4.20.0170.05716.45
5.4.10.0130.04716.50
5.4.00.0230.06316.03
5.3.290.0090.04012.80
5.3.280.0170.06714.68
5.3.270.0130.05014.63
5.3.260.0100.05314.69
5.3.250.0200.04714.68
5.3.240.0100.06014.44
5.3.230.0030.06014.69
5.3.220.0000.05714.57
5.3.210.0130.04714.72
5.3.200.0200.04314.40
5.3.190.0270.05014.76
5.3.180.0070.05014.47
5.3.170.0070.07314.57
5.3.160.0100.05314.54
5.3.150.0200.06014.65
5.3.140.0170.06314.55
5.3.130.0130.05014.64
5.3.120.0170.04714.71
5.3.110.0130.05314.56
5.3.100.0100.05714.11
5.3.90.0130.06014.15
5.3.80.0130.04314.10
5.3.70.0100.04714.04
5.3.60.0130.07014.09
5.3.50.0100.05014.04
5.3.40.0100.06013.96
5.3.30.0070.05014.00
5.3.20.0000.05713.86
5.3.10.0100.05013.81
5.3.00.0070.07013.73
5.2.170.0030.04711.10
5.2.160.0100.05311.10
5.2.150.0130.05011.15
5.2.140.0130.05711.22
5.2.130.0070.04011.27
5.2.120.0030.05711.08
5.2.110.0070.05011.07
5.2.100.0070.05711.18
5.2.90.0100.03711.27
5.2.80.0030.04311.05
5.2.70.0100.04711.17
5.2.60.0070.04011.06
5.2.50.0030.04711.20
5.2.40.0170.03711.18
5.2.30.0070.04311.16
5.2.20.0130.04311.04
5.2.10.0170.04010.94
5.2.00.0130.04010.73
5.1.60.0130.04010.09
5.1.50.0100.03710.04
5.1.40.0100.0379.95
5.1.30.0170.03010.36
5.1.20.0030.05710.44
5.1.10.0200.03710.13
5.1.00.0170.03710.16
5.0.50.0070.0278.74
5.0.40.0070.0238.67
5.0.30.0070.0508.42
5.0.20.0000.0338.12
5.0.10.0030.0378.24
5.0.00.0070.0408.16
4.4.90.0100.0236.62
4.4.80.0130.0136.62
4.4.70.0030.0206.62
4.4.60.0000.0236.58
4.4.50.0070.0276.58
4.4.40.0030.0376.59
4.4.30.0130.0206.59
4.4.20.0070.0206.59
4.4.10.0070.0276.59
4.4.00.0100.0276.59
4.3.110.0030.0206.59
4.3.100.0070.0236.59
4.3.90.0070.0276.59
4.3.80.0070.0306.59
4.3.70.0100.0236.59
4.3.60.0130.0106.59
4.3.50.0130.0206.59
4.3.40.0000.0336.59
4.3.30.0030.0206.59
4.3.20.0030.0206.59
4.3.10.0030.0206.59
4.3.00.0000.0236.34

preferences:
40.2 ms | 401 KiB | 5 Q