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($answer) { $class = new ReflectionClass($answer); var_dump($class->getProperty('answer')->getValue()); } } $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.0110.00718.40
8.3.50.0130.00522.12
8.3.40.0070.00718.79
8.3.30.0110.00819.09
8.3.20.0000.00720.34
8.3.10.0040.00421.92
8.3.00.0040.00422.34
8.2.180.0090.00617.00
8.2.170.0090.00622.96
8.2.160.0130.00320.93
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0060.00319.36
8.2.110.0040.00422.11
8.2.100.0080.00417.78
8.2.90.0040.00417.75
8.2.80.0050.00317.97
8.2.70.0040.00417.50
8.2.60.0030.00617.63
8.2.50.0060.00318.05
8.2.40.0040.00418.03
8.2.30.0070.00017.94
8.2.20.0040.00417.59
8.2.10.0050.00317.63
8.2.00.0000.00817.82
8.1.280.0030.01425.92
8.1.270.0080.00022.07
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00023.71
8.1.230.0100.00319.08
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00617.35
8.1.190.0000.00817.23
8.1.180.0050.00518.10
8.1.170.0000.00817.62
8.1.160.0000.00718.86
8.1.150.0000.00718.53
8.1.140.0000.00717.57
8.1.130.0050.00317.88
8.1.120.0040.00417.46
8.1.110.0030.00517.42
8.1.100.0030.00517.50
8.1.90.0000.00717.45
8.1.80.0000.00817.36
8.1.70.0000.00817.50
8.1.60.0070.00317.48
8.1.50.0000.00817.43
8.1.40.0000.00817.53
8.1.30.0050.00317.48
8.1.20.0030.00617.60
8.1.10.0040.00417.63
8.1.00.0060.00317.54
8.0.300.0070.00019.77
8.0.290.0000.00816.75
8.0.280.0040.00418.36
8.0.270.0030.00517.21
8.0.260.0030.00316.71
8.0.250.0030.00516.84
8.0.240.0000.00716.91
8.0.230.0000.00716.85
8.0.220.0030.00316.89
8.0.210.0030.00316.97
8.0.200.0000.00616.95
8.0.190.0040.00416.93
8.0.180.0070.00016.84
8.0.170.0000.00716.84
8.0.160.0000.00816.94
8.0.150.0000.00816.89
8.0.140.0040.00416.96
8.0.130.0000.00613.43
8.0.120.0000.00816.92
8.0.110.0040.00416.98
8.0.100.0080.00017.04
8.0.90.0000.00717.00
8.0.80.0030.01816.93
8.0.70.0000.00817.04
8.0.60.0000.00716.97
8.0.50.0040.00416.83
8.0.30.0120.01217.12
8.0.20.0090.01217.42
8.0.10.0050.00217.11
8.0.00.0150.00916.70
7.4.330.0000.00515.07
7.4.320.0040.00416.54
7.4.300.0000.00616.55
7.4.290.0000.00816.52
7.4.280.0050.00316.63
7.4.270.0000.00716.54
7.4.260.0000.00716.62
7.4.250.0000.00816.48
7.4.240.0060.00216.63
7.4.230.0030.00316.72
7.4.220.0060.01316.57
7.4.210.0090.01116.62
7.4.200.0030.00316.62
7.4.190.0050.00216.62
7.4.160.0080.00816.60
7.4.150.0120.00817.40
7.4.140.0110.00617.86
7.4.130.0090.01016.59
7.4.120.0070.01316.47
7.4.110.0100.00716.63
7.4.100.0110.00716.68
7.4.90.0200.00316.42
7.4.80.0150.00319.39
7.4.70.0130.00416.31
7.4.60.0110.01116.43
7.4.50.0000.00816.38
7.4.40.0120.00622.77
7.4.30.0070.01016.48
7.4.00.0040.01115.00
7.3.330.0070.00013.16
7.3.320.0030.00313.36
7.3.310.0040.00416.42
7.3.300.0030.00316.38
7.3.290.0090.00616.44
7.3.280.0080.00916.34
7.3.270.0110.00717.40
7.3.260.0120.00816.43
7.3.250.0090.00916.36
7.3.240.0060.01216.47
7.3.230.0110.00516.45
7.3.210.0030.01316.51
7.3.200.0080.01219.39
7.3.190.0120.00916.48
7.3.180.0070.01316.54
7.3.170.0120.01216.64
7.3.160.0070.01116.42
7.3.120.0090.00614.91
7.3.10.0070.00416.49
7.3.00.0080.00416.23
7.2.330.0140.00316.41
7.2.320.0150.00316.73
7.2.310.0110.00816.62
7.2.300.0060.01616.59
7.2.290.0080.00816.82
7.2.130.0060.00616.68
7.2.120.0090.00616.56
7.2.110.0020.00916.71
7.2.100.0040.01116.67
7.2.90.0050.01016.64
7.2.80.0050.00716.55
7.2.70.0030.00917.00
7.2.60.0060.00716.78
7.2.50.0080.00616.71
7.2.40.0020.00816.79
7.2.30.0020.01416.87
7.2.20.0050.00716.87
7.2.10.0090.00316.75
7.2.00.0000.01216.66
7.1.250.0000.00915.86
7.1.230.0070.00715.75
7.1.220.0070.00715.81
7.1.210.0030.00915.79
7.1.200.0040.01115.77
7.1.190.0030.00915.54
7.1.180.0000.01515.65
7.1.170.0040.00415.48
7.1.160.0090.00315.86
7.1.150.0100.00315.86
7.1.140.0030.00615.45
7.1.130.0040.01115.78
7.1.120.0000.01115.81
7.1.110.0060.00615.52
7.1.100.0050.00716.81
7.1.90.0040.01115.57
7.1.80.0030.01015.84
7.1.70.0060.00416.47
7.1.60.0150.00517.80
7.1.50.0090.01216.36
7.1.40.0000.01515.73
7.1.30.0110.00015.62
7.1.20.0070.01015.80
7.1.10.0060.00815.89
7.1.00.0050.04218.93
7.0.310.0080.00815.17
7.0.300.0080.00415.45
7.0.290.0070.00715.17
7.0.280.0000.01115.50
7.0.270.0000.01315.43
7.0.260.0040.01115.31
7.0.250.0030.01315.42
7.0.240.0070.00715.53
7.0.230.0030.01015.18
7.0.220.0080.00815.36
7.0.210.0070.00415.55
7.0.200.0040.00816.05
7.0.190.0030.01015.54
7.0.180.0030.01015.49
7.0.170.0030.01015.38
7.0.160.0060.00915.36
7.0.150.0030.01015.43
7.0.140.0060.03818.77
7.0.130.0040.00415.50
7.0.120.0030.01015.52
7.0.110.0060.00915.55
7.0.100.0040.00715.22
7.0.90.0040.01115.29
7.0.80.0060.00315.30
7.0.70.0020.04618.50
7.0.60.0020.03618.57
7.0.50.0020.03018.83
7.0.40.0120.03916.75
7.0.30.0060.03316.61
7.0.20.0060.04316.65
7.0.10.0100.02016.78
7.0.00.0020.02516.70
5.6.380.0100.00314.30
5.6.370.0140.00014.35
5.6.360.0120.00314.43
5.6.350.0140.00014.44
5.6.340.0000.01114.09
5.6.330.0090.00014.39
5.6.320.0070.00714.18
5.6.310.0060.00914.30
5.6.300.0000.01314.22
5.6.290.0120.00414.48
5.6.280.0080.03717.58
5.6.270.0090.00614.32
5.6.260.0070.00714.46
5.6.250.0120.00314.17
5.6.240.0070.00714.38
5.6.230.0060.00614.27
5.6.220.0020.03817.55
5.6.210.0030.04617.62
5.6.200.0080.04217.53
5.6.190.0080.04017.68
5.6.180.0070.02417.52
5.6.170.0050.02817.57
5.6.160.0050.02817.61
5.6.150.0070.04017.76
5.6.140.0060.03817.77
5.6.130.0070.04317.60
5.6.120.0100.03217.47
5.6.110.0050.04717.86
5.6.100.0050.04517.52
5.6.90.0090.04017.77
5.6.80.0020.04117.48
5.6.70.0080.02517.30
5.6.60.0070.04217.31
5.6.50.0070.02817.17
5.6.40.0110.02917.21
5.6.30.0070.03017.37
5.6.20.0100.02717.28
5.6.10.0020.04417.31
5.6.00.0040.03917.20
5.5.380.0060.00612.79
5.5.370.0090.00312.79
5.5.360.0070.04016.57
5.5.350.0030.03616.57
5.5.340.0050.03316.86
5.5.330.0070.03516.79
5.5.320.0040.03016.85
5.5.310.0080.03716.76
5.5.300.0050.02216.83
5.5.290.0040.02716.77
5.5.280.0080.03716.71
5.5.270.0030.03416.76
5.5.260.0020.02816.79
5.5.250.0030.02616.76
5.5.240.0030.02116.47
5.5.230.0050.02816.47
5.5.220.0050.03916.44
5.5.210.0030.04316.46
5.5.200.0040.02816.52
5.5.190.0030.03116.50
5.5.180.0030.03716.50
5.5.170.0070.00714.13
5.5.160.0070.02116.43
5.5.150.0080.02916.48
5.5.140.0020.02716.50
5.5.130.0050.03716.38
5.5.120.0030.03816.51
5.5.110.0050.02816.47
5.5.100.0030.03516.47
5.5.90.0090.03416.45
5.5.80.0080.03716.46
5.5.70.0060.03816.41
5.5.60.0050.03016.37
5.5.50.0060.03616.37
5.5.40.0050.02516.36
5.5.30.0050.03916.41
5.5.20.0050.03716.44
5.5.10.0060.03316.41
5.5.00.0030.03616.38
5.4.450.0050.03516.12
5.4.440.0030.03116.07
5.4.430.0050.02916.06
5.4.420.0000.02716.14
5.4.410.0070.03415.96
5.4.400.0030.03915.86
5.4.390.0030.03115.91
5.4.380.0050.03615.94
5.4.370.0050.03115.93
5.4.360.0070.03815.90
5.4.350.0050.04015.86
5.4.340.0060.03215.97
5.4.330.0060.00612.79
5.4.320.0070.02215.91
5.4.310.0020.03515.91
5.4.300.0050.03415.97
5.4.290.0050.02615.90
5.4.280.0050.04215.81
5.4.270.0070.03815.93
5.4.260.0060.03515.86
5.4.250.0070.03515.82
5.4.240.0020.03715.95
5.4.230.0020.03115.90
5.4.220.0100.03615.82
5.4.210.0000.03815.98
5.4.200.0050.04115.85
5.4.190.0030.02915.82
5.4.180.0060.03815.81
5.4.170.0030.03315.82
5.4.160.0050.03715.94
5.4.150.0040.03515.80
5.4.140.0090.03314.62
5.4.130.0050.03714.59
5.4.120.0000.04314.60
5.4.110.0050.04014.67
5.4.100.0080.03314.59
5.4.90.0000.04414.59
5.4.80.0080.03614.60
5.4.70.0050.03614.65
5.4.60.0030.03614.52
5.4.50.0020.03014.61
5.4.40.0060.03314.59
5.4.30.0050.04214.55
5.4.20.0050.03714.62
5.4.10.0080.03014.66
5.4.00.0060.03714.31
5.3.290.0040.04013.82
5.3.280.0030.03813.82
5.3.270.0020.04413.82
5.3.260.0030.04213.82
5.3.250.0070.03813.82
5.3.240.0150.02513.82
5.3.230.0000.03613.82
5.3.220.0050.03313.82
5.3.210.0000.04113.82
5.3.200.0020.04213.82
5.3.190.0050.04013.82
5.3.180.0030.04213.82
5.3.170.0030.03813.82
5.3.160.0070.03513.82
5.3.150.0080.03513.82
5.3.140.0020.04113.82
5.3.130.0050.04313.82
5.3.120.0060.03913.82
5.3.110.0030.04213.82
5.3.100.0030.04013.82
5.3.90.0030.03813.82
5.3.80.0030.03313.82
5.3.70.0050.03513.82
5.3.60.0080.03513.82
5.3.50.0040.03813.82
5.3.40.0080.03513.82
5.3.30.0040.03013.82
5.3.20.0050.03713.82
5.3.10.0030.03213.82
5.3.00.0030.04213.82
5.2.170.0040.03413.82
5.2.160.0050.03213.82
5.2.150.0040.02813.82
5.2.140.0050.02513.82
5.2.130.0060.02813.82
5.2.120.0050.03213.82
5.2.110.0020.03413.82
5.2.100.0050.03013.82
5.2.90.0030.03213.82
5.2.80.0050.02813.82
5.2.70.0000.03913.82
5.2.60.0030.03513.82
5.2.50.0000.03113.82
5.2.40.0030.03013.82
5.2.30.0000.03413.82
5.2.20.0040.03013.82
5.2.10.0030.03313.82
5.2.00.0050.03213.82
5.1.60.0020.02713.82
5.1.50.0050.02713.82
5.1.40.0040.02513.82
5.1.30.0040.03113.82
5.1.20.0030.02413.82
5.1.10.0010.03113.82
5.1.00.0050.01813.82
5.0.50.0050.01813.82
5.0.40.0020.02713.82
5.0.30.0000.03213.82
5.0.20.0020.02013.82
5.0.10.0000.02513.82
5.0.00.0050.03013.82
4.4.90.0000.01713.82
4.4.80.0040.01713.82
4.4.70.0030.01813.82
4.4.60.0000.02113.82
4.4.50.0000.01913.82
4.4.40.0020.02813.82
4.4.30.0000.02013.82
4.4.20.0000.02013.82
4.4.10.0010.01813.82
4.4.00.0020.02813.82
4.3.110.0010.02013.82
4.3.100.0000.01613.82
4.3.90.0020.02013.82
4.3.80.0050.02513.82
4.3.70.0060.01513.82
4.3.60.0050.01713.82
4.3.50.0030.01513.82
4.3.40.0050.02513.82
4.3.30.0030.01613.82
4.3.20.0020.02013.82
4.3.10.0030.01413.82
4.3.00.0030.01813.82

preferences:
61.33 ms | 401 KiB | 5 Q