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 extends Exception{ 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.0100.01018.56
8.3.50.0130.00821.21
8.3.40.0120.00318.92
8.3.30.0090.00618.92
8.3.20.0040.00420.25
8.3.10.0040.00421.92
8.3.00.0030.00722.52
8.2.180.0150.00316.75
8.2.170.0060.01222.96
8.2.160.0100.01020.38
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0100.00726.16
8.2.120.0040.00419.36
8.2.110.0030.00622.25
8.2.100.0080.00417.84
8.2.90.0090.00017.75
8.2.80.0070.00418.81
8.2.70.0060.00617.80
8.2.60.0030.00618.16
8.2.50.0000.01018.10
8.2.40.0040.00421.20
8.2.30.0060.00618.07
8.2.20.0000.00917.63
8.2.10.0030.00519.41
8.2.00.0050.00217.66
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0050.00326.35
8.1.250.0050.00228.09
8.1.240.0030.00623.73
8.1.230.0080.00319.16
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0040.00417.13
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0000.00818.57
8.1.160.0030.00621.96
8.1.150.0000.00718.70
8.1.140.0000.00717.46
8.1.130.0040.00417.84
8.1.120.0000.00717.47
8.1.110.0060.00317.35
8.1.100.0040.00417.44
8.1.90.0000.00717.39
8.1.80.0070.00017.37
8.1.70.0000.00717.45
8.1.60.0030.00617.59
8.1.50.0040.00417.43
8.1.40.0080.00017.47
8.1.30.0040.00417.54
8.1.20.0030.00517.63
8.1.10.0000.00817.48
8.1.00.0080.00017.58
8.0.300.0070.00019.64
8.0.290.0000.00716.75
8.0.280.0000.00718.35
8.0.270.0000.00817.20
8.0.260.0000.00716.84
8.0.250.0030.00317.02
8.0.240.0100.00017.07
8.0.230.0000.00717.00
8.0.220.0030.00616.97
8.0.210.0040.00416.93
8.0.200.0030.00316.93
8.0.190.0030.00516.98
8.0.180.0040.00417.04
8.0.170.0080.00016.98
8.0.160.0040.00416.91
8.0.150.0000.00716.94
8.0.140.0030.00316.96
8.0.130.0000.00613.38
8.0.120.0040.00416.87
8.0.110.0070.00016.89
8.0.100.0050.00216.82
8.0.90.0030.00316.90
8.0.80.0000.01516.94
8.0.70.0000.00717.00
8.0.60.0040.00416.83
8.0.50.0040.00417.00
8.0.30.0130.00717.26
8.0.20.0080.01117.40
8.0.10.0070.00016.96
8.0.00.0120.01216.93
7.4.330.0030.00315.04
7.4.320.0000.00616.53
7.4.300.0030.00316.65
7.4.290.0000.00716.50
7.4.280.0030.00316.51
7.4.270.0000.00816.65
7.4.260.0030.00316.61
7.4.250.0000.00816.47
7.4.240.0020.00616.44
7.4.230.0030.00316.39
7.4.220.0030.01316.57
7.4.210.0080.00616.56
7.4.200.0040.00416.50
7.4.190.0030.00516.69
7.4.160.0170.00016.28
7.4.150.0090.00917.40
7.4.140.0100.01117.86
7.4.130.0050.01416.55
7.4.120.0120.00816.59
7.4.110.0130.00416.52
7.4.100.0060.01716.67
7.4.90.0110.00616.57
7.4.80.0120.00919.39
7.4.70.0140.00416.59
7.4.60.0100.00716.56
7.4.50.0000.00416.49
7.4.40.0040.01122.77
7.4.30.0060.01016.41
7.4.00.0070.00714.82
7.3.330.0050.00013.23
7.3.320.0030.00313.36
7.3.310.0030.00316.23
7.3.300.0030.00316.40
7.3.290.0030.01216.37
7.3.280.0060.01016.38
7.3.270.0030.01417.40
7.3.260.0000.02016.43
7.3.250.0020.01616.43
7.3.240.0030.01316.50
7.3.230.0100.00716.39
7.3.210.0090.00916.42
7.3.200.0110.00619.39
7.3.190.0140.00916.36
7.3.180.0110.00616.55
7.3.170.0030.01216.47
7.3.160.0120.00316.53
7.3.120.0030.01014.75
7.2.330.0160.00216.64
7.2.320.0100.01416.45
7.2.310.0090.00916.53
7.2.300.0110.01116.69
7.2.290.0170.00416.46
7.2.60.0130.00016.95
7.1.200.0060.00615.93
7.1.70.0080.00016.89
7.1.60.0090.01319.82
7.1.50.0130.00916.91
7.1.00.0070.07322.44
7.0.200.0030.00716.61
7.0.140.0030.07322.07
7.0.60.0330.07319.96
7.0.50.0070.07317.94
7.0.40.0200.07720.09
7.0.30.0430.05020.09
7.0.20.0230.04720.24
7.0.10.0230.05720.22
7.0.00.0030.06020.29
5.6.210.0030.06020.51
5.6.200.0070.08718.16
5.6.190.0030.04320.61
5.6.180.0200.05320.50
5.6.170.0270.07720.57
5.6.160.0000.04320.55
5.6.150.0170.05718.14
5.6.140.0100.08018.18
5.6.130.0070.07318.27
5.6.120.0100.08321.01
5.6.110.0030.08721.11
5.6.100.0070.03721.01
5.6.90.0070.08721.02
5.6.80.0170.06020.52
5.5.350.0100.03720.36
5.5.340.0130.03017.95
5.5.330.0070.08020.13
5.5.320.0270.07720.51
5.5.310.0230.07020.41
5.5.300.0070.04718.02
5.5.290.0030.08717.99
5.5.280.0030.04020.89
5.5.270.0200.07020.87
5.5.260.0070.07020.87
5.5.250.0070.08720.69
5.5.240.0170.07020.19
5.4.450.0700.07319.54
5.4.440.0700.05719.30
5.4.430.0300.06019.66
5.4.420.0700.05719.58
5.4.410.0100.06019.04
5.4.400.0900.00018.77
5.4.390.0870.00018.84
5.4.380.0170.06318.54
5.4.370.0230.05018.63
5.4.360.0370.04718.54
5.4.350.0330.06318.52
5.4.340.0430.06018.48
5.4.320.0110.04112.50
5.4.310.0090.03612.50
5.4.300.0080.03412.50
5.4.290.0070.04412.50
5.4.280.0040.04012.40
5.4.270.0100.05718.79
5.4.260.0070.05318.77
5.4.250.0200.06019.00
5.4.240.0170.06719.07
5.4.230.0100.05019.00
5.4.220.0070.07718.94
5.4.210.0130.04718.99
5.4.200.0000.07018.95
5.4.190.0070.07718.94
5.4.180.0170.05718.93
5.4.170.0100.05318.92
5.4.160.0130.05018.98
5.4.150.0000.06318.63
5.4.140.0100.05316.64
5.4.130.0070.05016.52
5.4.120.0100.06316.63
5.4.110.0100.08016.61
5.4.100.0100.07316.59
5.4.90.0000.05716.42
5.4.80.0130.06716.50
5.4.70.0200.05716.55
5.4.60.0100.05016.33
5.4.50.0070.06316.52
5.4.40.0230.05316.45
5.4.30.0030.05316.43
5.4.20.0230.05316.34
5.4.10.0070.07316.57
5.4.00.0170.04015.85
5.3.290.0090.04412.80
5.3.280.0130.05014.66
5.3.270.0030.08014.76
5.3.260.0170.04714.68
5.3.250.0030.05314.59
5.3.240.0070.06714.59
5.3.230.0200.05014.59
5.3.220.0130.06014.61
5.3.210.0070.06014.54
5.3.200.0030.07014.66
5.3.190.0070.06014.66
5.3.180.0100.05014.57
5.3.170.0100.06314.59
5.3.160.0070.06314.65
5.3.150.0070.06714.70
5.3.140.0130.06714.55
5.3.130.0130.04714.64
5.3.120.0100.05314.73
5.3.110.0070.06714.55
5.3.100.0030.05714.12
5.3.90.0230.06313.98
5.3.80.0030.07013.86
5.3.70.0030.05313.85
5.3.60.0270.05313.98
5.3.50.0130.06014.02
5.3.40.0000.06013.96
5.3.30.0130.05013.92
5.3.20.0030.05013.79
5.3.10.0230.03313.66
5.3.00.0100.04313.86
5.2.170.0070.04011.15
5.2.160.0000.05711.05
5.2.150.0100.04711.13
5.2.140.0100.05311.23
5.2.130.0100.05310.93
5.2.120.0030.04011.18
5.2.110.0070.04311.21
5.2.100.0030.04311.29
5.2.90.0100.03711.17
5.2.80.0070.04311.08
5.2.70.0070.04011.10
5.2.60.0000.05011.02
5.2.50.0100.03711.03
5.2.40.0070.04710.83
5.2.30.0100.05311.20
5.2.20.0100.03710.87
5.2.10.0100.04310.77
5.2.00.0070.04010.64
5.1.60.0000.03710.18
5.1.50.0130.04010.01
5.1.40.0030.0339.99
5.1.30.0070.04010.34
5.1.20.0070.05310.36
5.1.10.0070.0439.99
5.1.00.0070.03710.14
5.0.50.0200.0238.59
5.0.40.0070.0238.61
5.0.30.0000.0478.21
5.0.20.0030.0278.04
5.0.10.0100.0208.27
5.0.00.0000.0438.26
4.4.90.0030.0236.65
4.4.80.0070.0206.65
4.4.70.0030.0306.65
4.4.60.0070.0176.65
4.4.50.0100.0236.65
4.4.40.0000.0406.65
4.4.30.0030.0206.65
4.4.20.0100.0176.65
4.4.10.0000.0306.65
4.4.00.0030.0376.65
4.3.110.0000.0336.65
4.3.100.0070.0176.65
4.3.90.0130.0106.65
4.3.80.0070.0436.65
4.3.70.0030.0276.65
4.3.60.0070.0176.65
4.3.50.0100.0176.65
4.3.40.0030.0406.65
4.3.30.0000.0236.65
4.3.20.0070.0176.65
4.3.10.0000.0236.65
4.3.00.0070.0237.32

preferences:
41.13 ms | 401 KiB | 5 Q