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 exceptionFun extends Exception { public $that; public function getAnswer($that) { $this->that = $that; $answerTime = Closure::bind($this->getPrivate, null, $that); var_dump($answerTime); } public function getPrivate() { $that = $this->that; return $that->answer; } } $e = new exceptionFun(); // 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.0120.00316.88
8.3.50.0310.00222.03
8.3.40.0110.00719.02
8.3.30.0070.00719.17
8.3.20.0040.00420.34
8.3.10.0030.00523.65
8.3.00.0050.00319.38
8.2.180.0090.00618.41
8.2.170.0120.00422.96
8.2.160.0130.00020.28
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00722.11
8.2.110.0100.00021.07
8.2.100.0040.00817.72
8.2.90.0070.00317.62
8.2.80.0030.00717.97
8.2.70.0030.00617.80
8.2.60.0000.00818.09
8.2.50.0030.00518.10
8.2.40.0050.00319.16
8.2.30.0000.00918.03
8.2.20.0060.00317.57
8.2.10.0000.00718.05
8.2.00.0070.00417.79
8.1.280.0100.00725.92
8.1.270.0030.00523.96
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00322.47
8.1.230.0040.00720.89
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0030.00617.38
8.1.190.0000.00817.25
8.1.180.0040.00418.10
8.1.170.0080.00018.52
8.1.160.0000.00822.09
8.1.150.0070.00318.63
8.1.140.0030.00617.40
8.1.130.0070.00017.77
8.1.120.0000.00817.50
8.1.110.0040.00417.53
8.1.100.0060.00317.38
8.1.90.0040.00417.50
8.1.80.0000.00717.54
8.1.70.0050.00217.40
8.1.60.0040.00417.65
8.1.50.0000.00817.41
8.1.40.0000.00817.45
8.1.30.0000.00917.55
8.1.20.0030.00517.72
8.1.10.0040.00417.62
8.1.00.0040.00417.49
8.0.300.0030.00320.13
8.0.290.0000.00716.75
8.0.280.0000.00718.41
8.0.270.0000.00717.21
8.0.260.0060.00017.23
8.0.250.0040.00417.00
8.0.240.0000.00716.84
8.0.230.0000.00717.04
8.0.220.0030.00316.81
8.0.210.0070.00016.93
8.0.200.0000.00617.01
8.0.190.0040.00416.94
8.0.180.0000.00716.88
8.0.170.0000.00716.84
8.0.160.0000.00716.94
8.0.150.0050.00216.88
8.0.140.0000.00816.96
8.0.130.0000.00613.37
8.0.120.0040.00416.86
8.0.110.0020.00516.91
8.0.100.0030.00516.93
8.0.90.0040.00417.01
8.0.80.0090.00617.01
8.0.70.0000.00816.86
8.0.60.0050.00217.04
8.0.50.0030.00316.84
8.0.30.0110.01117.07
8.0.20.0140.00417.40
8.0.10.0040.00417.00
8.0.00.0080.00916.80
7.4.330.0000.00515.00
7.4.320.0030.00316.49
7.4.300.0070.00016.42
7.4.290.0030.00616.62
7.4.280.0000.00716.54
7.4.270.0080.00016.54
7.4.260.0030.00316.59
7.4.250.0080.00016.40
7.4.240.0030.00316.58
7.4.230.0070.00016.71
7.4.220.0060.01216.71
7.4.210.0060.01116.54
7.4.200.0000.00716.73
7.4.190.0000.00716.58
7.4.160.0060.00916.40
7.4.150.0120.00617.40
7.4.140.0100.00817.86
7.4.130.0080.00916.63
7.4.120.0060.01116.53
7.4.110.0060.01516.64
7.4.100.0070.01016.58
7.4.90.0040.01316.34
7.4.80.0150.00919.39
7.4.70.0100.01016.46
7.4.60.0070.01116.55
7.4.50.0000.00816.62
7.4.40.0000.01422.77
7.4.30.0030.01316.68
7.4.10.0070.00715.07
7.4.00.0070.01015.02
7.3.330.0000.00613.32
7.3.320.0000.00513.31
7.3.310.0070.00016.21
7.3.300.0050.00316.32
7.3.290.0100.00316.30
7.3.280.0070.00916.35
7.3.270.0130.00617.40
7.3.260.0030.01516.46
7.3.250.0130.00316.51
7.3.240.0140.00316.57
7.3.230.0090.00916.45
7.3.210.0100.01016.52
7.3.200.0060.00819.39
7.3.190.0170.00316.44
7.3.180.0120.00316.38
7.3.170.0100.00716.36
7.3.160.0170.00016.46
7.3.130.0100.00715.07
7.3.120.0080.00914.82
7.3.110.0070.01114.76
7.3.100.0080.00614.98
7.3.90.0030.01014.82
7.3.80.0050.00814.81
7.3.70.0090.00414.75
7.3.60.0040.01014.88
7.3.50.0070.00414.77
7.3.40.0060.00914.91
7.3.30.0080.00414.82
7.3.20.0040.00916.71
7.3.10.0080.00816.69
7.3.00.0030.01016.61
7.2.330.0170.00016.80
7.2.320.0100.00616.52
7.2.310.0120.00616.70
7.2.300.0060.01216.81
7.2.290.0000.01716.54
7.2.260.0030.01115.35
7.2.250.0070.01215.06
7.2.240.0120.00314.84
7.2.230.0060.01014.93
7.2.220.0060.00914.88
7.2.210.0050.00814.74
7.2.200.0050.00715.06
7.2.190.0090.00215.13
7.2.180.0070.00614.95
7.2.170.0080.00715.04
7.2.160.0090.00315.29
7.2.150.0070.01116.87
7.2.140.0090.00916.96
7.2.130.0030.01016.94
7.2.120.0070.00716.98
7.2.110.0000.01517.02
7.2.100.0060.00917.02
7.2.90.0070.00716.94
7.2.80.0030.01217.01
7.2.70.0060.00616.73
7.2.60.0110.00416.95
7.2.50.0040.00717.07
7.2.40.0130.00317.12
7.2.30.0060.00916.88
7.2.20.0100.00716.78
7.2.10.0080.00416.78
7.2.00.0020.01418.19
7.1.330.0090.00415.74
7.1.320.0050.00815.75
7.1.310.0070.00515.66
7.1.300.0020.00915.77
7.1.290.0050.00915.88
7.1.280.0050.00715.68
7.1.270.0020.01115.97
7.1.260.0080.00615.76
7.1.250.0090.00015.82
7.1.240.0030.00615.80
7.1.230.0060.00915.90
7.1.220.0110.00415.70
7.1.210.0040.00415.79
7.1.200.0030.00815.88
7.1.190.0080.00615.91
7.1.180.0040.01115.72
7.1.170.0030.01015.91
7.1.160.0070.00715.81
7.1.150.0030.00915.63
7.1.140.0080.00515.75
7.1.130.0040.00815.64
7.1.120.0000.01415.80
7.1.110.0060.00615.89
7.1.100.0050.00916.81
7.1.90.0110.00415.72
7.1.80.0060.00615.93
7.1.70.0030.01116.43
7.1.60.0100.00617.56
7.1.50.0020.01516.30
7.1.40.0100.00315.57
7.1.30.0050.00415.72
7.1.20.0000.01115.45
7.1.10.0000.00915.47
7.1.00.0030.04719.06
7.0.330.0080.00315.42
7.0.320.0150.00015.37
7.0.310.0000.01415.39
7.0.300.0000.00915.44
7.0.290.0000.00815.45
7.0.280.0000.01615.44
7.0.270.0040.00415.25
7.0.260.0040.01115.28
7.0.250.0000.01915.48
7.0.240.0070.00715.34
7.0.230.0030.00615.44
7.0.220.0090.00315.54
7.0.210.0000.00815.53
7.0.200.0050.00616.11
7.0.190.0000.01215.55
7.0.180.0070.00715.21
7.0.170.0000.01315.54
7.0.160.0040.00815.28
7.0.150.0090.00315.24
7.0.140.0030.04118.77
7.0.130.0090.00615.20
7.0.120.0060.00615.51
7.0.110.0030.00715.57
7.0.100.0100.00315.20
7.0.90.0050.00315.39
7.0.80.0100.00315.55
7.0.70.0030.00915.22
7.0.60.0020.03417.79
7.0.50.0050.04516.68
7.0.40.0030.02516.65
7.0.30.0180.03016.84
7.0.20.0100.04716.73
7.0.10.0050.04916.90
7.0.00.0090.02516.83
5.6.400.0030.01114.51
5.6.390.0100.00314.59
5.6.380.0090.00614.20
5.6.370.0000.01514.36
5.6.360.0030.00614.35
5.6.350.0060.00614.71
5.6.340.0060.00814.31
5.6.330.0060.01014.53
5.6.320.0000.01414.41
5.6.310.0000.00914.21
5.6.300.0060.00914.32
5.6.290.0030.01014.70
5.6.280.0070.03717.67
5.6.270.0040.00814.51
5.6.260.0000.01514.36
5.6.250.0120.00314.34
5.6.240.0120.00314.54
5.6.230.0040.00414.24
5.6.220.0000.00814.58
5.6.210.0040.03617.56
5.6.200.0130.04016.26
5.6.190.0100.02517.50
5.6.180.0130.04317.38
5.6.170.0110.02417.34
5.6.160.0040.02417.38
5.6.150.0100.04016.42
5.6.140.0040.03316.24
5.6.130.0030.02816.37
5.6.120.0060.02317.78
5.6.110.0030.04717.60
5.6.100.0110.04017.59
5.6.90.0180.03717.81
5.6.80.0080.04117.45
5.6.70.1210.02117.32
5.6.60.0030.01214.35
5.6.50.0090.00014.15
5.6.40.0130.00014.20
5.6.30.0070.01114.20
5.6.20.0090.00014.23
5.6.10.0070.00314.34
5.6.00.0090.00614.41
5.5.380.0000.00914.44
5.5.370.0000.01514.67
5.5.360.0040.01114.26
5.5.350.0200.04017.44
5.5.340.0090.04116.10
5.5.330.0050.04117.32
5.5.320.0200.03717.35
5.5.310.0200.02517.36
5.5.300.0050.02816.20
5.5.290.0080.04316.27
5.5.280.0070.04517.56
5.5.270.0050.02817.73
5.5.260.0060.02217.48
5.5.250.0070.04617.61
5.5.240.1670.02217.31
5.5.230.0000.00814.41
5.5.220.0000.01214.41
5.5.210.0080.00014.20
5.5.200.0030.01014.30
5.5.190.0090.00614.37
5.5.180.0030.00914.50
5.5.170.0060.00614.55
5.5.160.0090.00314.08
5.5.150.0090.00614.44
5.5.140.0080.00614.15
5.5.130.0040.00414.37
5.5.120.0030.00914.46
5.5.110.0040.01114.44
5.5.100.0030.00913.90
5.5.90.0060.01214.35
5.5.80.0090.00614.24
5.5.70.0060.00614.47
5.5.60.0000.01114.36
5.5.50.0080.00814.55
5.5.40.0060.01014.14
5.5.30.0060.00914.33
5.5.20.0090.00314.33
5.5.10.0070.01014.04
5.5.00.0090.00314.39
5.4.450.0400.03215.42
5.4.440.0450.03015.37
5.4.430.0450.02715.45
5.4.420.0430.03615.35
5.4.410.0050.03315.03
5.4.400.0460.02615.09
5.4.390.0080.02715.07
5.4.380.0170.03014.97
5.4.370.0170.03014.90
5.4.360.0170.03414.87
5.4.350.0200.02914.71
5.4.340.0180.03815.09
5.4.330.0000.01010.81
5.4.320.0030.02711.80
5.4.310.0040.02811.78
5.4.300.0050.02411.80
5.4.290.0030.03011.86
5.4.280.0070.02511.71
5.4.270.0020.02411.82
5.4.260.0050.02311.76
5.4.250.0060.02311.67
5.4.240.0080.02111.87
5.4.230.0050.02511.85
5.4.220.0080.01911.85
5.4.210.0060.01911.73
5.4.200.0060.02211.90
5.4.190.0070.02111.74
5.4.180.0060.02811.60
5.4.170.0080.02011.78
5.4.160.0060.02511.77
5.4.150.0040.02411.75
5.4.140.0030.02511.71
5.4.130.0080.02311.57
5.4.120.0040.02511.46
5.4.110.0060.02911.51
5.4.100.0080.01711.67
5.4.90.0040.02611.54
5.4.80.0040.02511.62
5.4.70.0060.01811.58
5.4.60.0090.04211.62
5.4.50.0050.02711.43
5.4.40.0100.02311.59
5.4.30.0100.03611.58
5.4.20.0070.02911.44
5.4.10.0090.02511.54
5.4.00.0090.05411.36
5.3.290.0080.02211.76
5.3.280.0080.02811.65
5.3.270.0040.02611.55
5.3.260.0060.02411.64
5.3.250.0060.02811.54
5.3.240.0090.02311.50
5.3.230.0070.02911.65
5.3.220.0060.02711.53
5.3.210.0040.03411.56
5.3.200.0050.02411.65
5.3.190.0080.02911.64
5.3.180.0060.02811.70
5.3.170.0020.03311.67
5.3.160.0060.02211.71
5.3.150.0040.02411.68
5.3.140.0070.02011.68
5.3.130.0040.02511.64
5.3.120.0030.02711.63
5.3.110.0080.02711.66
5.3.100.0050.02411.41
5.3.90.0060.02111.37
5.3.80.0030.02411.30
5.3.70.0050.02211.31
5.3.60.0060.02011.29
5.3.50.0060.02011.17
5.3.40.0030.02311.27
5.3.30.0070.02311.20
5.3.20.0040.02311.21
5.3.10.0070.02311.00
5.3.00.0070.03011.01
5.2.170.0050.0519.23
5.2.160.0060.0299.23
5.2.150.0080.0349.23
5.2.140.0100.0449.23
5.2.130.0110.0439.19
5.2.120.0050.0469.19
5.2.110.0070.0419.20
5.2.100.0070.0419.19
5.2.90.0080.0409.20
5.2.80.0060.0439.19
5.2.70.0060.0439.19
5.2.60.0050.0449.14
5.2.50.0090.0409.11
5.2.40.0040.0419.09
5.2.30.0080.0409.06
5.2.20.0020.0339.05
5.2.10.0040.0488.96
5.2.00.0060.0408.82
5.1.60.0040.0428.10
5.1.50.0040.0348.10
5.1.40.0040.0288.08
5.1.30.0040.0268.43
5.1.20.0020.0288.45
5.1.10.0030.0288.18
5.1.00.0020.0308.17
5.0.50.0040.0226.66
5.0.40.0050.0256.51
5.0.30.0060.0396.32
5.0.20.0040.0266.30
5.0.10.0080.0236.28
5.0.00.0030.0326.27
4.4.90.0070.0184.78
4.4.80.0030.0184.76
4.4.70.0040.0184.75
4.4.60.0060.0194.75
4.4.50.0050.0214.77
4.4.40.0080.0304.70
4.4.30.0030.0224.76
4.4.20.0030.0234.84
4.4.10.0010.0254.85
4.4.00.0070.0254.76
4.3.110.0020.0254.67
4.3.100.0020.0164.66
4.3.90.0040.0154.64
4.3.80.0020.0274.58
4.3.70.0030.0154.63
4.3.60.0010.0174.62
4.3.50.0030.0164.63
4.3.40.0040.0254.54
4.3.30.0010.0183.30
4.3.20.0010.0223.28
4.3.10.0040.0163.23
4.3.00.0170.02310.54

preferences:
46.75 ms | 401 KiB | 5 Q