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 Hello extends Exception { public function getAnswer($class) { return (new ReflectionClass('Question'))->getProperty('answer')->getValue($class); } } $e = new Hello(); // 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.0040.01218.43
8.3.50.0100.00821.96
8.3.40.0070.01119.02
8.3.30.0070.00719.17
8.3.20.0040.00420.18
8.3.10.0040.00422.09
8.3.00.0050.00222.52
8.2.180.0080.00816.63
8.2.170.0140.00722.96
8.2.160.0070.00720.22
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0070.00726.16
8.2.120.0110.00719.54
8.2.110.0060.00322.26
8.2.100.0080.00419.43
8.2.90.0040.00419.23
8.2.80.0030.00619.21
8.2.70.0050.00317.50
8.2.60.0110.00017.80
8.2.50.0080.00018.07
8.2.40.0060.00318.16
8.2.30.0050.00218.07
8.2.20.0030.00617.73
8.2.10.0000.00717.63
8.2.00.0000.00817.73
8.1.280.0070.01125.92
8.1.270.0060.00320.36
8.1.260.0070.00026.35
8.1.250.0050.00228.09
8.1.240.0060.00323.69
8.1.230.0070.00419.00
8.1.220.0060.00317.74
8.1.210.0030.00618.77
8.1.200.0060.00317.48
8.1.190.0000.00817.52
8.1.180.0040.00419.14
8.1.170.0090.00018.61
8.1.160.0050.00322.21
8.1.150.0040.00418.64
8.1.140.0040.00417.45
8.1.130.0030.00317.70
8.1.120.0000.00717.46
8.1.110.0040.00417.43
8.1.100.0060.00317.36
8.1.90.0000.00717.39
8.1.80.0040.00417.37
8.1.70.0040.00417.34
8.1.60.0040.00417.49
8.1.50.0040.00417.55
8.1.40.0040.00417.51
8.1.30.0050.00217.55
8.1.20.0040.00417.60
8.1.10.0050.00317.56
8.1.00.0040.00417.37
8.0.300.0050.00218.77
8.0.290.0070.00017.18
8.0.280.0070.00018.50
8.0.270.0040.00417.25
8.0.260.0060.00016.92
8.0.250.0000.00716.91
8.0.240.0090.00016.91
8.0.230.0040.00416.93
8.0.220.0000.00716.86
8.0.210.0000.00716.81
8.0.200.0030.00317.00
8.0.190.0070.00016.95
8.0.180.0000.00716.95
8.0.170.0000.00716.97
8.0.160.0070.00016.80
8.0.150.0030.00316.91
8.0.140.0000.00816.88
8.0.130.0050.00013.37
8.0.120.0000.00816.89
8.0.110.0030.00516.86
8.0.100.0000.00717.04
8.0.90.0070.00016.93
8.0.80.0080.00816.95
8.0.70.0040.00416.79
8.0.60.0040.00416.84
8.0.50.0070.00017.00
8.0.30.0100.00917.07
8.0.20.0060.01217.40
8.0.10.0050.00216.97
8.0.00.0100.00816.74
7.4.330.0000.00515.00
7.4.320.0030.00316.50
7.4.300.0030.00316.54
7.4.290.0000.00716.62
7.4.280.0070.00016.52
7.4.270.0070.00016.64
7.4.260.0000.00716.66
7.4.250.0000.00716.59
7.4.240.0030.00416.48
7.4.230.0070.00016.45
7.4.220.0140.00516.46
7.4.210.0080.00916.56
7.4.200.0070.00016.64
7.4.190.0050.00316.75
7.4.160.0070.01016.65
7.4.150.0090.00917.40
7.4.140.0100.00717.86
7.4.130.0070.01316.55
7.4.120.0070.01016.46
7.4.110.0090.01516.58
7.4.100.0150.00916.61
7.4.90.0170.00716.68
7.4.80.0000.01719.39
7.4.70.0160.00616.60
7.4.60.0070.01016.61
7.4.50.0030.00316.36
7.4.40.0000.01622.77
7.4.30.0040.01216.58
7.4.10.0090.00915.08
7.4.00.0100.00714.90
7.3.330.0000.00613.36
7.3.320.0050.00013.18
7.3.310.0000.00716.24
7.3.300.0040.00416.35
7.3.290.0060.01316.38
7.3.280.0060.01216.34
7.3.270.0060.01117.40
7.3.260.0110.00616.39
7.3.250.0140.00816.47
7.3.240.0030.01616.45
7.3.230.0090.00416.58
7.3.210.0100.00716.43
7.3.200.0080.01219.39
7.3.190.0120.00616.57
7.3.180.0120.00316.54
7.3.170.0060.00916.58
7.3.160.0090.00616.55
7.3.130.0100.00614.78
7.3.120.0040.01314.86
7.3.110.0100.00614.89
7.3.100.0100.00814.93
7.3.90.0020.01214.79
7.3.80.0020.01314.79
7.3.70.0070.00514.58
7.3.60.0120.00214.67
7.3.50.0040.00814.79
7.3.40.0080.00514.78
7.3.30.0020.01214.86
7.3.20.0060.00616.67
7.3.10.0080.00616.57
7.3.00.0130.00016.56
7.2.330.0060.01216.46
7.2.320.0120.00616.67
7.2.310.0120.00416.69
7.2.300.0060.01216.80
7.2.290.0150.00316.70
7.2.260.0000.01915.26
7.2.250.0100.00615.03
7.2.240.0070.00915.03
7.2.230.0060.00915.14
7.2.220.0050.00714.88
7.2.210.0070.00814.93
7.2.200.0050.00815.07
7.2.190.0020.01214.96
7.2.180.0100.00315.15
7.2.170.0050.00615.14
7.2.160.0020.01214.95
7.2.150.0060.00816.74
7.2.140.0050.00916.73
7.2.130.0050.00616.89
7.2.120.0050.00816.87
7.2.110.0030.01116.90
7.2.100.0090.00616.75
7.2.90.0070.00716.85
7.2.80.0050.00916.87
7.2.70.0080.00516.68
7.2.60.0090.00716.89
7.2.50.0030.01416.68
7.2.40.0050.01216.95
7.2.30.0090.00916.88
7.2.20.0050.01116.77
7.2.10.0110.00416.88
7.2.00.0010.01317.77
7.1.330.0050.00715.75
7.1.320.0070.00915.78
7.1.310.0040.00715.83
7.1.300.0100.00215.80
7.1.290.0050.00915.70
7.1.280.0080.00715.64
7.1.270.0100.00315.61
7.1.260.0050.00715.65
7.1.250.0010.00915.48
7.1.240.0030.00815.62
7.1.230.0060.00915.88
7.1.220.0070.00615.57
7.1.210.0050.01215.69
7.1.200.0120.00515.48
7.1.190.0070.00715.69
7.1.180.0050.01015.56
7.1.170.0040.01015.62
7.1.160.0100.00315.59
7.1.150.0070.00715.55
7.1.140.0050.00915.68
7.1.130.0070.00915.77
7.1.120.0030.00815.67
7.1.110.0070.00715.72
7.1.100.0070.01016.58
7.1.90.0050.01015.74
7.1.80.0050.00815.85
7.1.70.0040.00816.30
7.1.60.0060.01216.99
7.1.50.0020.01416.04
7.1.40.0030.01115.70
7.1.30.0050.00815.83
7.1.20.0050.00715.64
7.1.10.0020.01115.58
7.1.00.0030.01817.95
7.0.330.0060.00415.34
7.0.320.0050.01115.36
7.0.310.0070.00615.20
7.0.300.0080.00715.16
7.0.290.0060.00915.21
7.0.280.0030.01315.59
7.0.270.0050.00915.38
7.0.260.0060.00415.41
7.0.250.0050.01015.40
7.0.240.0040.01115.58
7.0.230.0070.00515.42
7.0.220.0070.00615.50
7.0.210.0100.00515.34
7.0.200.0050.00616.03
7.0.190.0070.00615.51
7.0.180.0120.00315.38
7.0.170.0020.00915.34
7.0.160.0030.00815.28
7.0.150.0060.00515.30
7.0.140.0080.02617.63
7.0.130.0020.00915.26
7.0.120.0060.00615.62
7.0.110.0050.00715.36
7.0.100.0100.00215.37
7.0.90.0060.00515.32
7.0.80.0020.01115.54
7.0.70.0050.00615.43
7.0.60.0080.01716.89
7.0.50.0100.02816.30
7.0.40.0100.03015.49
7.0.30.0160.02615.66
7.0.20.0120.02815.53
7.0.10.0120.02715.74
7.0.00.0090.03015.80
5.6.400.0050.00714.37
5.6.390.0020.01114.29
5.6.380.0060.00814.46
5.6.370.0080.00714.50
5.6.360.0050.00714.32
5.6.350.0050.01114.44
5.6.340.0060.00614.35
5.6.330.0020.01114.20
5.6.320.0060.00914.24
5.6.310.0030.01114.41
5.6.300.0040.00814.21
5.6.290.0060.00514.21
5.6.280.0060.02816.44
5.6.270.0090.00414.52
5.6.260.0020.01214.38
5.6.250.0040.01114.20
5.6.240.0060.00614.59
5.6.230.0060.00714.44
5.6.220.0060.00614.41
5.6.210.0070.02616.39
5.6.200.0100.02415.53
5.6.190.0040.03216.47
5.6.180.0050.02616.41
5.6.170.0150.02316.26
5.6.160.0060.03416.31
5.6.150.0060.02115.70
5.6.140.0050.01815.50
5.6.130.0030.03415.55
5.6.120.0050.01816.54
5.6.110.0080.01716.48
5.6.100.0100.02816.47
5.6.90.0090.02916.63
5.6.80.0080.03016.31
5.6.70.0090.03216.26
5.6.60.0050.00814.13
5.6.50.0030.01014.04
5.6.40.0030.00814.15
5.6.30.0070.00814.27
5.6.20.0100.00714.08
5.6.10.0080.00714.14
5.6.00.0010.01214.28
5.5.380.0050.00514.03
5.5.370.0050.00814.33
5.5.360.0030.01413.99
5.5.350.0120.03016.30
5.5.340.0080.03215.62
5.5.330.0040.03716.25
5.5.320.0090.02116.26
5.5.310.0100.01816.21
5.5.300.0060.02015.52
5.5.290.0090.03115.52
5.5.280.0050.01616.36
5.5.270.0050.02316.40
5.5.260.0080.02816.32
5.5.250.0030.01916.21
5.5.240.0070.02816.30
5.5.230.0030.00814.22
5.5.220.0020.01114.13
5.5.210.0070.00613.94
5.5.200.0050.00514.28
5.5.190.0060.00714.36
5.5.180.0050.00814.29
5.5.170.0030.00714.06
5.5.160.0050.00814.29
5.5.150.0050.00713.89
5.5.140.0010.01314.37
5.5.130.0020.01214.27
5.5.120.0040.00814.38
5.5.110.0020.01114.29
5.5.100.0020.01214.06
5.5.90.0050.00813.85
5.5.80.0050.00914.04
5.5.70.0070.00514.11
5.5.60.0040.00814.27
5.5.50.0050.00814.15
5.5.40.0050.00914.21
5.5.30.0090.00714.03
5.5.20.0050.00514.13
5.5.10.0050.00713.98
5.5.00.0040.00914.15
5.4.450.0180.02314.28
5.4.440.0140.02714.24
5.4.430.0150.02514.35
5.4.420.0160.01414.31
5.4.410.0160.02914.13
5.4.400.0150.02514.11
5.4.390.0080.02214.14
5.4.380.0140.02814.20
5.4.370.0150.02814.08
5.4.360.0140.01814.13
5.4.350.0110.02114.18
5.4.340.0130.02814.26
5.4.330.0030.00711.74
5.4.320.0110.02814.06
5.4.310.0150.02514.22
5.4.300.0120.02714.07
5.4.290.0090.01814.24
5.4.280.0120.01414.17
5.4.270.0150.01614.14
5.4.260.0110.03114.12
5.4.250.0120.02214.17
5.4.240.0110.03014.11
5.4.230.0110.01914.19
5.4.220.0140.02114.17
5.4.210.0130.01814.09
5.4.200.0100.02514.13
5.4.190.0100.02914.13
5.4.180.0120.02714.25
5.4.170.0140.02614.16
5.4.160.0110.02514.16
5.4.150.0120.02414.26
5.4.140.0150.02513.15
5.4.130.0100.02313.23
5.4.120.0100.02613.30
5.4.110.0110.02413.27
5.4.100.0170.02113.24
5.4.90.0140.02613.38
5.4.80.0100.01413.33
5.4.70.0140.02113.28
5.4.60.0110.01813.19
5.4.50.0100.02213.29
5.4.40.0100.01913.31
5.4.30.0150.01413.18
5.4.20.0100.01613.25
5.4.10.0110.01513.28
5.4.00.0150.02113.14
5.3.290.0140.01912.51
5.3.280.0100.01912.32
5.3.270.0090.02712.50
5.3.260.0090.02012.43
5.3.250.0090.01912.44
5.3.240.0150.02812.35
5.3.230.0140.02312.47
5.3.220.0120.02812.38
5.3.210.0160.02512.41
5.3.200.0100.02112.38
5.3.190.0190.02412.46
5.3.180.0120.01312.46
5.3.170.0200.01412.53
5.3.160.0120.03012.55
5.3.150.0130.01912.46
5.3.140.0130.02312.42
5.3.130.0140.02712.32
5.3.120.0140.01612.41
5.3.110.0100.03012.48
5.3.100.0130.02212.27
5.3.90.0170.02512.25
5.3.80.0120.01912.13
5.3.70.0160.02112.21
5.3.60.0100.01812.15
5.3.50.0120.03012.16
5.3.40.0080.01612.27
5.3.30.0150.02012.10
5.3.20.0110.02812.08
5.3.10.0120.02412.08
5.3.00.0150.02612.00
5.2.170.0270.04712.50
5.2.160.0230.03712.50
5.2.150.0200.03312.50
5.2.140.0330.03712.50
5.2.130.0230.05712.50
5.2.120.0370.05012.50
5.2.110.0230.05712.50
5.2.100.0200.06012.50
5.2.90.0300.04712.50
5.2.80.0300.05312.50
5.2.70.0200.03312.50
5.2.60.0330.04312.50
5.2.50.0230.06312.50
5.2.40.0200.06012.50
5.2.30.0300.05312.50
5.2.20.0170.05012.50
5.2.10.0230.05312.50
5.2.00.0200.04712.50
5.1.60.0170.05312.50
5.1.50.0170.05012.50
5.1.40.0200.04012.50
5.1.30.0130.04012.50
5.1.20.0170.05012.50
5.1.10.0270.04712.50
5.1.00.0230.05312.50
5.0.50.0100.04012.50
5.0.40.0100.02312.50
5.0.30.0070.06312.50
5.0.20.0130.04312.50
5.0.10.0100.03712.50
5.0.00.0200.05712.50
4.4.90.0130.02712.50
4.4.80.0070.02312.50
4.4.70.0170.03312.50
4.4.60.0130.02712.50
4.4.50.0070.03012.50
4.4.40.0070.05712.50
4.4.30.0130.02312.50
4.4.20.0130.01712.50
4.4.10.0130.03312.50
4.4.00.0070.03312.50
4.3.110.0070.02312.50
4.3.100.0130.02312.50
4.3.90.0130.02012.50
4.3.80.0130.05012.50
4.3.70.0100.03012.50
4.3.60.0170.02312.50
4.3.50.0130.03012.50
4.3.40.0070.04712.50
4.3.30.0130.03312.50
4.3.20.0070.03712.50
4.3.10.0030.03312.50
4.3.00.0030.02712.50

preferences:
48.36 ms | 401 KiB | 5 Q