3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fn = function () { return get_called_class(); }; var_dump((new ReflectionFunction($fn))->getClosureScopeClass()); class C { public function __construct() { $fn = function () { return get_called_class(); }; $res = (new ReflectionFunction($fn))->getClosureScopeClass(); var_dump(get_class($res)); var_dump($res->getName()); } public static function s_fn() { $fn = function () { return get_called_class(); }; $res = (new ReflectionFunction($fn))->getClosureScopeClass(); var_dump(get_class($res)); var_dump($res->getName()); } } class D extends C { public function __construct() { static::s_fn(); } } $c = new C; C::s_fn(); $d = new D;

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.01116.48
8.3.50.0120.00722.84
8.3.40.0150.00018.70
8.3.30.0140.00318.96
8.3.20.0000.00820.16
8.3.10.0030.00623.60
8.3.00.0040.00419.23
8.2.180.0090.00916.75
8.2.170.0070.01422.96
8.2.160.0110.00320.43
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.01
8.2.110.0030.00619.45
8.2.100.0090.00317.91
8.2.90.0000.00819.21
8.2.80.0040.00417.97
8.2.70.0000.00917.63
8.2.60.0030.00618.05
8.2.50.0060.00318.07
8.2.40.0080.00019.68
8.2.30.0060.00317.96
8.2.20.0030.00617.75
8.2.10.0050.00317.99
8.2.00.0000.00717.77
8.1.280.0100.00725.92
8.1.270.0050.00324.01
8.1.260.0060.00326.35
8.1.250.0000.00728.09
8.1.240.0070.00422.09
8.1.230.0040.00721.09
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0000.00918.50
8.1.160.0000.00721.96
8.1.150.0040.00418.81
8.1.140.0000.00817.47
8.1.130.0070.00017.77
8.1.120.0070.00017.43
8.1.110.0000.00817.50
8.1.100.0030.00717.49
8.1.90.0000.00817.54
8.1.80.0020.00517.45
8.1.70.0030.00317.35
8.1.60.0030.00517.56
8.1.50.0060.00317.50
8.1.40.0000.00817.53
8.1.30.0000.00817.71
8.1.20.0030.00617.72
8.1.10.0040.00417.59
8.1.00.0060.00317.42
8.0.300.0040.00420.07
8.0.290.0090.00016.58
8.0.280.0000.00718.27
8.0.270.0000.00717.21
8.0.260.0030.00317.22
8.0.250.0000.00716.84
8.0.240.0030.00516.92
8.0.230.0070.00016.77
8.0.220.0030.00316.71
8.0.210.0000.00716.80
8.0.200.0000.00717.01
8.0.190.0040.00716.87
8.0.180.0040.00416.97
8.0.170.0040.00416.93
8.0.160.0050.00216.80
8.0.150.0040.00416.90
8.0.140.0000.00716.74
8.0.130.0030.00313.31
8.0.120.0040.00416.76
8.0.110.0060.00316.84
8.0.100.0040.00416.96
8.0.90.0050.00216.68
8.0.80.0070.01716.85
8.0.70.0050.00216.87
8.0.60.0040.00416.91
8.0.50.0000.00816.86
8.0.30.0080.01516.83
8.0.20.0060.01717.40
8.0.10.0040.00416.89
8.0.00.0100.00716.73
7.4.330.0050.00015.00
7.4.320.0000.00716.44
7.4.300.0000.00616.52
7.4.290.0000.00716.62
7.4.280.0060.00316.58
7.4.270.0030.00316.64
7.4.260.0070.00016.64
7.4.250.0080.00016.55
7.4.240.0040.00316.55
7.4.230.0040.00416.71
7.4.220.0070.01116.51
7.4.210.0090.00616.57
7.4.200.0000.00716.59
7.4.160.0100.01016.65
7.4.150.0130.01017.40
7.4.140.0130.00617.86
7.4.130.0140.00316.39
7.4.120.0110.00816.58
7.4.110.0100.00616.34
7.4.100.0060.01216.32
7.4.90.0090.00916.52
7.4.80.0140.00319.39
7.4.70.0070.01016.42
7.4.60.0120.00616.71
7.4.50.0000.00816.37
7.4.40.0090.00916.53
7.4.30.0040.01116.55
7.4.00.0060.01114.83
7.3.330.0030.00313.29
7.3.320.0050.00013.23
7.3.310.0070.00016.41
7.3.300.0030.00316.35
7.3.290.0100.01016.38
7.3.280.0110.00516.39
7.3.270.0060.01317.40
7.3.260.0080.01416.39
7.3.250.0110.00616.32
7.3.240.0060.01216.57
7.3.230.0030.01416.39
7.3.210.0130.00316.46
7.3.200.0120.00919.39
7.3.190.0110.00516.61
7.3.180.0030.01616.61
7.3.170.0030.01216.36
7.3.160.0040.01216.66
7.3.120.0130.00514.61
7.3.110.0100.00514.69
7.3.100.0070.00914.94
7.3.90.0080.00414.87
7.3.80.0130.00214.91
7.3.70.0020.01214.79
7.3.60.0080.00614.80
7.3.50.0040.00714.81
7.3.40.0020.01314.76
7.3.30.0100.00514.82
7.3.20.0040.01216.60
7.3.10.0040.00916.54
7.3.00.0050.01216.68
7.2.330.0110.00616.52
7.2.320.0120.00916.72
7.2.310.0070.01016.44
7.2.300.0100.00616.75
7.2.290.0060.02116.71
7.2.250.0080.00514.93
7.2.240.0070.01214.93
7.2.230.0110.00414.87
7.2.220.0020.01614.93
7.2.210.0050.00815.04
7.2.200.0050.01215.02
7.2.190.0060.00914.96
7.2.180.0050.00714.76
7.2.170.0100.00714.86
7.2.60.0030.01316.93
7.2.00.0030.01319.53
7.1.330.0100.00515.85
7.1.320.0080.00515.70
7.1.310.0030.01115.69
7.1.300.0080.00315.83
7.1.290.0060.00815.71
7.1.280.0060.00815.68
7.1.270.0100.00515.73
7.1.260.0060.00615.64
7.1.200.0090.00315.84
7.1.100.0030.00717.94
7.1.70.0030.00617.23
7.1.60.0180.00619.40
7.1.50.0170.00316.89
7.1.00.0000.07722.33
7.0.200.0020.00516.53
7.0.140.0100.06721.95
7.0.60.0070.08021.66
7.0.50.0070.08017.88
7.0.40.0070.08720.04
7.0.30.0230.07720.20
7.0.20.0230.04720.09
7.0.10.0130.04320.21
7.0.00.0070.09020.24
5.6.280.0100.06320.92
5.6.210.0030.08020.49
5.6.200.0100.08018.19
5.6.190.0070.04020.58
5.6.180.0370.06720.52
5.6.170.0370.06320.45
5.6.160.0200.07020.50
5.6.150.0030.04018.15
5.6.140.0070.03318.21
5.6.130.0000.06318.16
5.6.120.0070.08021.16
5.6.110.0100.06720.98
5.6.100.0130.05721.04
5.6.90.0070.04021.09
5.6.80.0030.07720.55
5.5.350.0200.03320.39
5.5.340.0070.04017.95
5.5.330.0100.08020.42
5.5.320.0300.05720.36
5.5.310.0330.06320.24
5.5.300.0000.04018.05
5.5.290.0170.03018.07
5.5.280.0030.08020.82
5.5.270.0030.04320.75
5.5.260.0070.05320.88
5.5.250.0030.04320.48
5.5.240.0170.07020.17
5.4.450.3630.03719.50
5.4.440.0030.07719.54
5.4.430.2000.05319.25
5.4.420.4470.04319.50
5.4.410.2430.03319.40
5.4.400.4130.04318.95
5.4.390.3400.04319.21
5.4.380.3270.03319.15
5.4.370.3600.03719.11
5.4.360.3730.03319.14
5.4.350.0370.03719.04
5.4.340.0070.03318.97
5.4.320.3570.04019.14
5.4.310.3870.04018.93
5.4.300.3970.03019.14
5.4.290.3830.04019.21
5.4.280.3800.04319.24
5.4.270.3900.04018.93
5.4.260.3500.04018.96
5.4.250.3430.04719.05
5.4.240.3830.04018.94
5.4.230.4270.04019.12
5.4.220.3870.03719.06
5.4.210.4830.02719.03
5.4.200.3900.03719.19
5.4.190.4530.03719.14
5.4.180.3730.03019.20
5.4.170.3670.04019.02
5.4.160.3630.03318.98
5.4.150.3870.03319.13
5.4.140.3630.04016.55
5.4.130.4130.04016.40
5.4.120.3670.03716.54
5.4.110.3530.04016.54
5.4.100.3670.04016.60
5.4.90.3570.03316.61
5.4.80.3770.03716.52
5.4.70.3800.03316.26
5.4.60.3800.03716.51
5.4.50.3630.03016.53
5.4.40.3630.02316.24
5.4.30.4800.02016.53
5.4.20.3700.03716.33
5.4.10.3570.03716.21
5.4.00.3530.04015.95
5.3.290.3630.03314.71
5.3.280.4000.03314.48
5.3.270.3970.03714.61
5.3.260.3770.02714.62
5.3.250.4200.03714.67
5.3.240.3600.03314.61
5.3.230.3870.03714.62
5.3.220.3670.03714.55
5.3.210.3900.05014.59
5.3.200.3800.04014.64
5.3.190.3630.03714.57
5.3.180.3800.03714.61
5.3.170.3530.03714.48
5.3.160.4230.03714.45
5.3.150.4130.04014.57
5.3.140.3570.03314.58
5.3.130.3130.03314.54
5.3.120.3930.04014.46
5.3.110.3970.04314.62
5.3.100.3930.03014.09
5.3.90.4200.03714.17
5.3.80.3870.03714.01
5.3.70.3900.03714.04
5.3.60.3970.04714.16
5.3.50.3700.03714.02
5.3.40.3530.03713.89
5.3.30.3770.03313.91
5.3.20.3730.04013.73
5.3.10.3830.03713.65
5.3.00.3870.03313.68
5.2.170.3300.03011.05
5.2.160.3270.02311.04
5.2.150.3230.03011.00
5.2.140.2870.02711.29
5.2.130.3300.02711.03
5.2.120.3330.02311.07
5.2.110.3170.03011.01
5.2.100.3000.02010.98
5.2.90.3070.03011.08
5.2.80.3430.03011.03
5.2.70.3400.03711.10
5.2.60.3300.02711.05
5.2.50.3470.02710.94
5.2.40.2730.03010.87
5.2.30.2830.02310.97
5.2.20.2830.03310.89
5.2.10.2630.03310.76
5.2.00.2630.02710.70
5.1.60.2400.0309.95
5.1.50.2430.02010.00
5.1.40.2800.0239.81
5.1.30.2470.03010.33
5.1.20.3000.02010.34
5.1.10.3200.0209.91
5.1.00.3230.01710.02
5.0.50.1470.0208.38
5.0.40.1430.0208.40
5.0.30.1800.0308.23
5.0.20.1400.0208.10
5.0.10.0930.0208.23
5.0.00.1170.0338.15
4.4.90.1270.0136.47
4.4.80.1330.0136.47
4.4.70.1230.0106.47
4.4.60.1570.0176.47
4.4.50.1500.0176.47
4.4.40.1170.0276.47
4.4.30.1470.0206.47
4.4.20.1930.0136.47
4.4.10.1730.0176.47
4.4.00.1430.0276.47
4.3.110.1700.0176.47
4.3.100.1700.0176.47
4.3.90.1330.0136.47
4.3.80.1570.0236.24
4.3.70.1000.0176.24
4.3.60.1200.0136.24
4.3.50.1200.0176.24
4.3.40.0400.0236.24
4.3.30.0070.0136.24
4.3.20.0500.0136.24
4.3.10.0330.0206.24
4.3.00.0030.0176.24

preferences:
41.3 ms | 401 KiB | 5 Q