3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { $f = function() { return get_called_class(); }; return $f(); } class A { protected $a; public function foo() { function () { set_error_handler(function() {}); $class = get_called_class(); restore_error_handler(); return $class; }; $f = function() { echo a(); }; $f(); } } $a = new A; $a->foo();

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.40.0070.00718.63
8.3.30.0030.01020.20
8.3.20.0070.00020.34
8.3.10.0000.00822.11
8.3.00.0040.00422.46
8.2.170.0030.01722.96
8.2.160.0080.00620.52
8.2.150.0040.00424.18
8.2.140.0060.00924.66
8.2.130.0080.00026.16
8.2.120.0060.00319.70
8.2.110.0030.00622.16
8.2.100.0070.00319.28
8.2.90.0060.00319.22
8.2.80.0040.00418.04
8.2.70.0040.00417.38
8.2.60.0050.00317.93
8.2.50.0050.00318.07
8.2.40.0060.00318.16
8.2.30.0070.00017.98
8.2.20.0030.00517.79
8.2.10.0080.00017.75
8.2.00.0100.00017.81
8.1.270.0060.00320.27
8.1.260.0050.00326.35
8.1.250.0030.00528.09
8.1.240.0060.00323.99
8.1.230.0090.00318.85
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0040.00417.25
8.1.190.0000.00817.29
8.1.180.0000.00918.77
8.1.170.0000.00918.53
8.1.160.0030.00622.15
8.1.150.0030.00518.63
8.1.140.0040.00417.33
8.1.130.0030.00317.75
8.1.120.0000.00817.38
8.1.110.0040.00417.47
8.1.100.0050.00517.46
8.1.90.0050.00217.53
8.1.80.0070.00017.43
8.1.70.0030.00317.44
8.1.60.0050.00317.59
8.1.50.0040.00417.55
8.1.40.0000.00817.42
8.1.30.0020.00517.58
8.1.20.0060.00317.67
8.1.10.0040.00417.45
8.1.00.0000.01017.35
8.0.300.0000.00718.77
8.0.290.0060.00317.16
8.0.280.0050.00318.34
8.0.270.0000.00717.25
8.0.260.0030.00316.84
8.0.250.0000.00716.95
8.0.240.0050.00317.00
8.0.230.0070.00016.84
8.0.220.0060.00316.94
8.0.210.0000.00816.91
8.0.200.0040.00417.02
8.0.190.0030.00316.90
8.0.180.0040.00417.03
8.0.170.0030.00516.92
8.0.160.0040.00417.01
8.0.150.0000.00816.96
8.0.140.0000.01016.81
8.0.130.0030.00313.46
8.0.120.0040.00416.88
8.0.110.0040.00416.99
8.0.100.0070.00016.81
8.0.90.0000.00717.07
8.0.80.0000.01516.94
8.0.70.0030.00516.82
8.0.60.0070.00016.94
8.0.50.0000.00816.95
8.0.30.0080.01017.21
8.0.20.0110.00817.40
8.0.10.0000.00717.08
8.0.00.0120.00916.89
7.4.330.0000.00615.07
7.4.320.0060.00016.58
7.4.300.0030.00316.41
7.4.290.0040.00416.54
7.4.280.0000.00716.58
7.4.270.0070.00016.53
7.4.260.0000.00716.49
7.4.250.0050.00216.46
7.4.240.0050.00216.48
7.4.230.0000.00816.44
7.4.220.0120.00616.68
7.4.210.0100.00816.59
7.4.200.0040.00416.54
7.4.190.0030.00316.41
7.4.160.0060.00916.43
7.4.150.0160.00617.40
7.4.140.0070.01317.86
7.4.130.0100.00816.54
7.4.120.0120.01316.50
7.4.110.0070.01016.54
7.4.100.0060.01116.31
7.4.90.0160.00016.63
7.4.80.0100.00719.39
7.4.70.0090.01016.61
7.4.60.0120.00616.48
7.4.50.0000.00816.51
7.4.40.0070.00722.77
7.4.30.0090.00916.62
7.4.00.0070.00914.98
7.3.330.0050.00013.23
7.3.320.0000.00513.22
7.3.310.0000.00716.40
7.3.300.0030.00316.37
7.3.290.0120.00316.38
7.3.280.0060.00816.35
7.3.270.0060.01317.40
7.3.260.0160.01016.44
7.3.250.0070.00916.49
7.3.240.0120.00616.41
7.3.230.0090.00916.42
7.3.210.0090.00916.27
7.3.200.0060.01019.39
7.3.190.0040.01716.51
7.3.180.0070.01116.36
7.3.170.0160.00616.61
7.3.160.0090.00616.43
7.3.120.0100.00714.82
7.3.110.0040.00814.82
7.3.100.0030.00614.53
7.3.90.0040.00814.78
7.3.80.0030.00914.93
7.3.70.0030.00614.79
7.3.60.0030.00614.35
7.3.50.0000.00914.71
7.3.40.0090.00014.81
7.3.30.0040.00814.79
7.3.20.0030.00616.26
7.3.10.0100.00316.47
7.3.00.0100.00716.59
7.2.330.0090.00916.67
7.2.320.0130.00316.44
7.2.310.0100.00716.55
7.2.300.0110.00616.78
7.2.290.0120.00816.49
7.2.250.0000.02115.26
7.2.240.0130.00615.23
7.2.230.0070.00715.15
7.2.220.0030.00914.77
7.2.210.0040.00715.20
7.2.200.0040.01115.15
7.2.190.0090.00015.04
7.2.180.0030.01015.04
7.2.170.0000.01614.83
7.2.00.0060.01019.14
7.1.330.0070.00715.82
7.1.320.0060.00615.60
7.1.310.0070.00415.89
7.1.300.0070.00715.43
7.1.290.0090.00615.68
7.1.280.0060.00315.69
7.1.270.0060.00615.67
7.1.260.0070.00715.67
7.1.100.0040.01118.16
7.1.70.0000.00716.81
7.1.60.0000.01316.89
7.1.50.0030.01416.73
7.1.00.0030.07722.27
7.0.200.0090.00916.32
7.0.140.0000.07322.11
7.0.60.0070.08320.00
7.0.50.0070.04717.86
7.0.40.0000.06020.13
7.0.30.0230.05320.07
7.0.20.0200.08720.22
7.0.10.0230.05020.15
7.0.00.0070.04320.25
5.6.280.0070.07021.16
5.6.210.0030.08320.73
5.6.200.0130.05318.20
5.6.190.0100.04320.63
5.6.180.4100.04720.50
5.6.170.0170.04020.47
5.6.160.0200.07320.55
5.6.150.0170.03718.27
5.6.140.0100.04318.16
5.6.130.0130.06018.25
5.6.120.0130.06021.16
5.6.110.0070.08321.11
5.6.100.0030.08321.15
5.6.90.0130.03321.03
5.6.80.0100.06320.42
5.6.70.0270.06720.39
5.5.350.0070.08720.48
5.5.340.0070.05017.96
5.5.330.0100.04320.31
5.5.320.0230.08320.24
5.5.310.0200.05320.36
5.5.300.0100.06018.09
5.5.290.0070.08017.97
5.5.280.0030.06020.66
5.5.270.0030.08720.90
5.5.260.0070.05720.98
5.5.250.0100.06020.67
5.5.240.0100.07320.23
5.4.450.0670.06319.61
5.4.440.0670.06019.34
5.4.430.0900.05719.59
5.4.420.0200.04319.16
5.4.410.0900.05319.57
5.4.400.1570.07018.84
5.4.390.1230.05718.77
5.4.380.0300.04718.59
5.4.370.0100.05718.75
5.4.360.0200.04318.62
5.4.350.0100.04812.03
5.4.340.0110.03812.03
5.4.320.0050.03812.52
5.4.310.0060.03712.51
5.4.300.0020.04012.52
5.4.290.0050.04512.52
5.4.280.0050.03712.41
5.4.270.0080.03412.41
5.4.260.0090.04112.41
5.4.250.0070.05318.97
5.4.240.0070.05019.00
5.4.230.0070.05018.90
5.4.220.0130.05719.07
5.4.210.0130.04718.77
5.4.200.0000.05719.00
5.4.190.0230.03719.02
5.4.180.0100.04718.98
5.4.170.0100.05718.65
5.4.160.0030.05319.05
5.4.150.0070.05719.08
5.4.140.0130.04716.32
5.4.130.0130.04316.52
5.4.120.0070.05316.58
5.4.110.0100.04716.54
5.4.100.0030.05016.54
5.4.90.0000.05316.70
5.4.80.0000.05316.56
5.4.70.0100.05016.53
5.4.60.0130.04716.53
5.4.50.0230.03716.52
5.4.40.0100.06716.51
5.4.30.0130.04716.48
5.4.20.0030.05016.46
5.4.10.0070.06716.48
5.4.00.0130.04315.80
5.3.290.0050.04012.80
5.3.280.0030.06014.52
5.3.270.0070.05014.84
5.3.260.0030.05714.53
5.3.250.0070.05014.71
5.3.240.0030.06014.81
5.3.230.0100.05314.70
5.3.220.0000.05714.70
5.3.210.0100.06014.57
5.3.200.0030.05014.50
5.3.190.0070.05014.66
5.3.180.0130.04314.59
5.3.170.0130.04314.57
5.3.160.0130.04714.49
5.3.150.0070.06014.60
5.3.140.0030.05314.71
5.3.130.0070.08014.57
5.3.120.0030.05314.54
5.3.110.0170.06314.58
5.3.100.0230.05014.14
5.3.90.0100.05014.26
5.3.80.0070.05314.13
5.3.70.0070.04714.15
5.3.60.0100.04714.04
5.3.50.0130.04314.14
5.3.40.0130.05714.06
5.3.30.0070.05014.00
5.3.20.0030.05013.70
5.3.10.0070.04713.75
5.3.00.0070.04713.84
5.2.170.0130.03311.09
5.2.160.0070.04711.30
5.2.150.0100.04710.96
5.2.140.0130.05311.10
5.2.130.0000.05711.17
5.2.120.0030.04311.10
5.2.110.0070.04311.27
5.2.100.0000.06311.16
5.2.90.0070.03711.17
5.2.80.0100.03711.31
5.2.70.0100.03711.18
5.2.60.0130.04310.89
5.2.50.0070.04011.02
5.2.40.0130.04711.15
5.2.30.0030.04011.03
5.2.20.0070.03710.93
5.2.10.0130.05711.04
5.2.00.0100.04710.68
5.1.60.0030.04710.08
5.1.50.0100.0309.98
5.1.40.0000.0439.94
5.1.30.0100.03010.55
5.1.20.0100.03710.43
5.1.10.0070.03310.07
5.1.00.0200.02010.02
5.0.50.0070.0338.61
5.0.40.0070.0238.51
5.0.30.0100.0338.21
5.0.20.0000.0378.21
5.0.10.0070.0308.21
5.0.00.0070.0408.21
4.4.90.0030.0208.21
4.4.80.0030.0278.21
4.4.70.0000.0238.21
4.4.60.0000.0278.21
4.4.50.0170.0178.21
4.4.40.0000.0378.20
4.4.30.0030.0238.20
4.4.20.0030.0208.21
4.4.10.0030.0308.21
4.4.00.0000.0338.21
4.3.110.0030.0208.21
4.3.100.0070.0178.21
4.3.90.0100.0138.21
4.3.80.0030.0338.21
4.3.70.0000.0238.21
4.3.60.0000.0238.21
4.3.50.0070.0178.21
4.3.40.0000.0338.21
4.3.30.0000.0238.21
4.3.20.0000.0238.21
4.3.10.0000.0238.21
4.3.00.0130.0276.77

preferences:
48.17 ms | 400 KiB | 5 Q