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) { $reflectionClass = new ReflectionClass('Question'); $property = $reflectionClass->getProperty('answer'); $property->setAccessible(true); return $question->answer; } } $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.0150.00416.75
8.3.50.0140.00321.97
8.3.40.0100.01018.97
8.3.30.0140.00319.09
8.3.20.0030.00520.27
8.3.10.0040.00423.48
8.3.00.0030.00720.82
8.2.180.0120.00316.88
8.2.170.0070.01022.96
8.2.160.0110.00320.39
8.2.150.0050.00224.18
8.2.140.0050.00324.66
8.2.130.0020.00526.16
8.2.120.0050.00222.13
8.2.110.0040.00722.28
8.2.100.0070.00417.78
8.2.90.0000.00719.05
8.2.80.0000.00817.97
8.2.70.0090.00017.63
8.2.60.0000.00917.91
8.2.50.0090.00018.07
8.2.40.0060.00318.22
8.2.30.0080.00018.02
8.2.20.0070.00017.61
8.2.10.0040.00417.66
8.2.00.0050.00217.70
8.1.280.0090.00625.92
8.1.270.0050.00223.99
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0040.00423.79
8.1.230.0030.00717.52
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0040.00417.65
8.1.180.0000.00818.10
8.1.170.0080.00318.64
8.1.160.0000.00821.95
8.1.150.0000.00918.58
8.1.140.0000.00717.39
8.1.130.0070.00017.75
8.1.120.0030.00317.48
8.1.110.0000.00717.33
8.1.100.0030.00417.48
8.1.90.0000.00717.42
8.1.80.0030.00317.46
8.1.70.0030.00317.39
8.1.60.0000.00817.64
8.1.50.0030.00517.55
8.1.40.0050.00317.56
8.1.30.0040.00417.66
8.1.20.0040.00417.64
8.1.10.0000.00717.63
8.1.00.0020.00517.46
8.0.300.0000.00918.77
8.0.290.0040.00416.75
8.0.280.0040.00418.41
8.0.270.0000.00717.15
8.0.260.0030.00316.84
8.0.250.0070.00017.01
8.0.240.0030.00317.00
8.0.230.0000.00716.85
8.0.220.0030.00316.81
8.0.210.0030.00316.89
8.0.200.0070.00017.01
8.0.190.0040.00416.87
8.0.180.0000.00816.92
8.0.170.0030.00616.82
8.0.160.0050.00316.89
8.0.150.0040.00416.83
8.0.140.0080.00016.86
8.0.130.0060.00013.48
8.0.120.0080.00016.93
8.0.110.0070.00016.96
8.0.100.0000.00716.86
8.0.90.0050.00317.02
8.0.80.0060.01016.93
8.0.70.0040.00416.98
8.0.60.0050.00316.80
8.0.50.0080.00016.88
8.0.30.0080.01117.23
8.0.20.0090.01117.41
8.0.10.0000.00816.99
8.0.00.0150.02016.72
7.4.330.0000.00515.15
7.4.320.0000.00616.54
7.4.300.0000.00616.57
7.4.290.0030.00616.43
7.4.280.0040.00416.44
7.4.270.0000.00716.55
7.4.260.0000.00716.53
7.4.250.0000.00816.50
7.4.240.0030.00516.57
7.4.230.0000.00716.66
7.4.220.0100.01616.53
7.4.210.0080.00716.61
7.4.200.0030.00316.65
7.4.190.0000.00816.67
7.4.160.0070.01016.45
7.4.150.0100.00717.40
7.4.140.0090.00917.86
7.4.130.0110.00516.49
7.4.120.0130.00416.69
7.4.110.0120.00316.44
7.4.100.0090.00916.54
7.4.90.0140.00416.62
7.4.80.0170.00716.42
7.4.70.0100.00716.57
7.4.60.0150.00316.60
7.4.50.0030.00516.52
7.4.40.0060.00922.77
7.4.30.0130.00916.45
7.4.10.0100.01016.49
7.4.00.0070.01215.87
7.3.330.0000.00613.34
7.3.320.0050.00013.39
7.3.310.0070.00016.43
7.3.300.0000.00716.34
7.3.290.0030.01316.36
7.3.280.0090.00916.37
7.3.270.0090.01317.40
7.3.260.0200.00616.48
7.3.250.0100.00616.47
7.3.240.0090.01216.63
7.3.230.0060.01116.39
7.3.210.0130.00316.54
7.3.200.0120.01219.39
7.3.190.0120.00616.47
7.3.180.0060.01516.41
7.3.170.0000.01516.54
7.3.160.0060.00916.58
7.3.130.0100.00716.32
7.3.120.0080.00615.62
7.3.110.0070.00716.27
7.3.100.0030.00916.29
7.3.90.0100.00716.36
7.3.80.0060.00916.41
7.3.70.0040.01116.34
7.3.60.0050.01116.38
7.3.50.0040.01516.33
7.3.40.0000.01916.34
7.3.30.0070.01416.41
7.3.20.0080.01118.19
7.3.10.0080.01118.01
7.3.00.0110.00818.17
7.2.330.0110.00716.74
7.2.320.0160.00616.43
7.2.310.0110.01516.72
7.2.300.0180.00016.66
7.2.290.0050.01116.73
7.2.260.0100.01016.69
7.2.250.0070.01416.63
7.2.240.0030.00916.65
7.2.230.0030.01416.63
7.2.220.0070.01016.64
7.2.210.0090.00616.51
7.2.200.0060.01016.52
7.2.190.0100.01016.63
7.2.180.0030.01716.35
7.2.170.0000.01916.53
7.2.160.0110.01116.63
7.2.150.0090.00918.47
7.2.140.0070.00718.44
7.2.130.0090.01618.31
7.2.120.0030.01718.28
7.2.110.0120.00318.25
7.2.100.0090.00918.24
7.2.90.0080.01618.41
7.2.80.0090.00318.24
7.2.70.0150.00418.30
7.2.60.0050.01317.34
7.2.50.0030.01318.37
7.2.40.0100.00618.50
7.2.30.0060.00918.41
7.2.20.0100.00318.38
7.2.10.0030.01018.43
7.2.00.0070.01018.25
7.1.330.0030.01017.34
7.1.320.0060.01217.32
7.1.310.0140.00317.37
7.1.300.0030.01517.43
7.1.290.0060.01317.27
7.1.280.0100.01017.43
7.1.270.0120.00417.14
7.1.260.0130.00617.47
7.1.250.0140.00417.23
7.1.240.0060.00917.45
7.1.230.0000.01317.27
7.1.220.0070.00717.41
7.1.210.0070.01117.40
7.1.200.0090.00516.65
7.1.190.0040.00717.18
7.1.180.0100.00717.36
7.1.170.0070.00717.13
7.1.160.0000.01617.36
7.1.150.0030.00617.34
7.1.140.0030.01017.11
7.1.130.0090.00617.24
7.1.120.0030.01017.11
7.1.110.0040.01117.45
7.1.100.0040.00717.33
7.1.90.0000.01117.25
7.1.80.0120.00317.25
7.1.70.0000.01217.36
7.1.60.0070.01318.34
7.1.50.0090.00917.19
7.1.40.0060.00917.19
7.1.30.0100.00317.41
7.1.20.0060.00617.34
7.1.10.0070.01117.18
7.1.00.0050.04219.80
7.0.330.0110.00716.92
7.0.320.0070.00717.05
7.0.310.0000.01316.91
7.0.300.0030.01016.98
7.0.290.0100.00717.29
7.0.280.0080.00416.86
7.0.270.0100.01317.05
7.0.260.0060.01217.07
7.0.250.0070.00716.96
7.0.240.0070.00316.89
7.0.230.0000.01217.17
7.0.220.0000.01317.16
7.0.210.0030.00816.89
7.0.200.0030.00716.93
7.0.190.0090.00317.08
7.0.180.0030.01417.09
7.0.170.0080.00517.13
7.0.160.0030.01016.98
7.0.150.0090.00617.09
7.0.140.0050.04319.44
7.0.130.0060.00617.18
7.0.120.0070.00717.00
7.0.110.0070.00717.14
7.0.100.0000.01216.98
7.0.90.0030.00917.03
7.0.80.0030.01117.18
7.0.70.0030.01017.18
7.0.60.0130.04318.48
7.0.50.0060.02417.36
7.0.40.0070.02717.56
7.0.30.0300.04417.60
7.0.20.0160.02617.59
7.0.10.0080.04517.55
7.0.00.0110.03317.57
5.6.400.0060.01215.74
5.6.390.0090.00915.61
5.6.380.0070.01015.77
5.6.370.0040.01215.84
5.6.360.0000.01415.85
5.6.350.0070.00715.86
5.6.340.0040.00815.74
5.6.330.0060.01615.63
5.6.320.0060.00315.59
5.6.310.0090.00615.79
5.6.300.0100.00715.89
5.6.290.0000.01415.86
5.6.280.0050.03818.46
5.6.270.0030.00616.00
5.6.260.0120.00315.86
5.6.250.0000.01015.62
5.6.240.0030.01316.05
5.6.230.0000.01315.72
5.6.220.0120.00815.71
5.6.210.0110.03018.23
5.6.200.0070.04716.98
5.6.190.0020.04518.12
5.6.180.0210.02318.18
5.6.170.0190.04718.37
5.6.160.0080.04918.22
5.6.150.0060.03817.14
5.6.140.0050.03016.97
5.6.130.0080.02516.96
5.6.120.0040.03218.37
5.6.110.0080.03218.56
5.6.100.0100.02418.60
5.6.90.0110.04618.46
5.6.80.0110.04118.03
5.6.70.0070.01415.70
5.6.60.0090.00915.70
5.6.50.0110.00415.56
5.6.40.0090.00915.69
5.6.30.0110.01115.66
5.6.20.0120.00615.80
5.6.10.0110.01115.77
5.6.00.0140.00615.82
5.5.380.0030.01215.76
5.5.370.0030.01015.68
5.5.360.0030.01015.91
5.5.350.0150.04118.05
5.5.340.0050.02316.88
5.5.330.0080.02218.07
5.5.320.0210.04318.05
5.5.310.0190.03818.16
5.5.300.0100.02016.96
5.5.290.0050.02616.99
5.5.280.0080.04318.40
5.5.270.0100.02018.27
5.5.260.0070.04718.12
5.5.250.0070.04218.10
5.5.240.0200.03517.96
5.5.230.0000.00915.64
5.5.220.0070.00715.59
5.5.210.0000.01615.68
5.5.200.0100.01015.78
5.5.190.0060.01515.81
5.5.180.0030.01215.63
5.5.170.0030.00615.90
5.5.160.0030.01015.81
5.5.150.0030.01015.66
5.5.140.0080.00415.52
5.5.130.0060.00915.45
5.5.120.0030.01015.73
5.5.110.0060.00315.66
5.5.100.0060.00615.42
5.5.90.0030.01315.70
5.5.80.0000.01115.59
5.5.70.0040.00815.66
5.5.60.0080.00815.74
5.5.50.0090.00615.71
5.5.40.0050.00515.55
5.5.30.0130.00315.48
5.5.20.0110.00015.25
5.5.10.0070.01015.47
5.5.00.0030.00915.61
5.4.450.0050.01915.97
5.4.440.0500.03015.96
5.4.430.0070.03115.74
5.4.420.0320.03515.82
5.4.410.0400.03115.93
5.4.400.0480.02815.74
5.4.390.0430.03415.64
5.4.380.0090.03315.63
5.4.370.0030.03715.55
5.4.360.0120.02815.49
5.4.350.0080.03115.44
5.4.340.0080.03015.59
5.4.330.0060.00312.42
5.4.320.0050.02512.41
5.4.310.0050.02112.39
5.4.300.0110.01912.32
5.4.290.0070.02212.40
5.4.280.0070.01912.29
5.4.270.0020.02412.25
5.4.260.0050.02712.41
5.4.250.0070.02112.53
5.4.240.0040.02712.35
5.4.230.0040.02412.38
5.4.220.0060.02312.42
5.4.210.0020.02312.21
5.4.200.0040.02312.39
5.4.190.0060.02212.39
5.4.180.0070.02012.21
5.4.170.0040.02412.25
5.4.160.0080.02012.27
5.4.150.0070.01912.43
5.4.140.0020.02712.32
5.4.130.0060.02012.31
5.4.120.0070.01912.16
5.4.110.0060.02112.28
5.4.100.0070.02112.28
5.4.90.0050.02112.22
5.4.80.0020.02312.27
5.4.70.0070.01812.25
5.4.60.0040.02112.13
5.4.50.0060.02312.20
5.4.40.0060.01912.21
5.4.30.0080.01812.27
5.4.20.0050.02012.15
5.4.10.0040.02212.17
5.4.00.0070.02011.92
5.3.290.0070.02413.02
5.3.280.0050.02412.84
5.3.270.0070.02413.02
5.3.260.0080.02513.02
5.3.250.0060.02012.89
5.3.240.0070.02012.85
5.3.230.0020.02612.85
5.3.220.0050.02012.74
5.3.210.0030.02412.86
5.3.200.0040.02512.80
5.3.190.0080.02812.83
5.3.180.0060.02912.91
5.3.170.0030.02812.95
5.3.160.0040.02412.88
5.3.150.0070.02112.92
5.3.140.0080.02012.98
5.3.130.0050.02212.84
5.3.120.0070.02212.85
5.3.110.0080.02312.93
5.3.100.0030.02312.66
5.3.90.0060.02212.60
5.3.80.0070.02012.52
5.3.70.0080.02312.57
5.3.60.0050.02412.58
5.3.50.0020.02512.64
5.3.40.0040.02412.55
5.3.30.0040.02812.42
5.3.20.0030.02312.37
5.3.10.0060.02012.25
5.3.00.0060.02312.28
5.2.170.0070.0289.19
5.2.160.0070.0369.19
5.2.150.0090.0379.19
5.2.140.0040.0349.18
5.2.130.0040.0329.14
5.2.120.0080.0379.14
5.2.110.0100.0319.15
5.2.100.0030.0399.15
5.2.90.0040.0369.15
5.2.80.0070.0309.14
5.2.70.0100.0379.13
5.2.60.0050.0319.09
5.2.50.0080.0289.06
5.2.40.0110.0239.04
5.2.30.0060.0319.01
5.2.20.0050.0299.01
5.2.10.0060.0298.92
5.2.00.0020.0328.77
5.1.60.0060.0228.06
5.1.50.0040.0258.06
5.1.40.0060.0238.05
5.1.30.0010.0328.39
5.1.20.0070.0318.41
5.1.10.0050.0268.14
5.1.00.0060.0248.13
5.0.50.0040.0206.61
5.0.40.0070.0196.47
5.0.30.0040.0336.29
5.0.20.0020.0226.26
5.0.10.0050.0206.23
5.0.00.0040.0316.22
4.4.90.0020.0174.78
4.4.80.0040.0174.75
4.4.70.0030.0164.76
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0000.0284.71
4.4.30.0040.0154.76
4.4.20.0040.0164.84
4.4.10.0020.0164.85
4.4.00.0030.0254.76
4.3.110.0060.0134.67
4.3.100.0010.0164.66
4.3.90.0020.0164.63
4.3.80.0040.0264.58
4.3.70.0050.0174.63
4.3.60.0020.0214.63
4.3.50.0020.0164.62
4.3.40.0010.0264.54
4.3.30.0010.0173.29
4.3.20.0010.0223.26
4.3.10.0020.0213.23
4.3.00.0230.01713.14

preferences:
46.98 ms | 401 KiB | 5 Q