3v4l.org

run code in 300+ PHP versions simultaneously
<?php /*namespace MyProject; use blah\blah as mine; // see "Using namespaces: importing/aliasing" blah\mine(); // calls function MyProject\blah\mine() namespace\blah\mine(); // calls function MyProject\blah\mine() namespace\func(); // calls function MyProject\func() namespace\sub\func(); // calls function MyProject\sub\func() namespace\cname::method(); // calls static method "method" of class MyProject\cname $a = new namespace\sub\cname(); // instantiates object of class MyProject\sub\cname $b = namespace\CONSTANT; // assigns value of constant MyProject\CONSTANT to $b ?>*/ namespace MyProject; class Asdf { function get($classname) { $a = __NAMESPACE__ . '\\' . $classname; return new $a; return new self; return new static; } function get2($classname) { return new self; } function get3($classname) { return new static; } } var_dump(get('asdF')); var_dump(get2('asdF')); var_dump(get3('asdF'));

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.0100.01018.30
8.3.50.0070.01121.14
8.3.40.0070.00718.66
8.3.30.0110.00420.35
8.3.20.0070.00020.34
8.3.10.0080.00022.10
8.3.00.0040.00422.52
8.2.180.0070.00716.75
8.2.170.0040.01122.96
8.2.160.0100.00722.26
8.2.150.0050.00324.18
8.2.140.0090.00024.66
8.2.130.0000.00826.16
8.2.120.0070.00020.83
8.2.110.0080.00321.12
8.2.100.0000.01217.70
8.2.90.0030.00619.05
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0090.00017.67
8.2.50.0080.00018.10
8.2.40.0000.00820.30
8.2.30.0030.00519.35
8.2.20.0040.00417.72
8.2.10.0040.00417.67
8.2.00.0000.00817.69
8.1.280.0140.00325.92
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0080.00422.05
8.1.230.0070.00420.31
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0060.00317.13
8.1.190.0030.00617.23
8.1.180.0030.00618.10
8.1.170.0050.00518.33
8.1.160.0040.00422.04
8.1.150.0040.00418.38
8.1.140.0000.00717.33
8.1.130.0000.00717.68
8.1.120.0030.00617.37
8.1.110.0030.00317.23
8.1.100.0080.00017.29
8.1.90.0070.00017.37
8.1.80.0070.00017.29
8.1.70.0030.00317.35
8.1.60.0060.00317.47
8.1.50.0000.00817.34
8.1.40.0040.00417.36
8.1.30.0040.00417.56
8.1.20.0040.00417.52
8.1.10.0060.00317.55
8.1.00.0000.00717.47
8.0.300.0070.00018.77
8.0.290.0080.00016.75
8.0.280.0030.00318.30
8.0.270.0050.00217.30
8.0.260.0000.00616.87
8.0.250.0000.00716.93
8.0.240.0080.00316.95
8.0.230.0040.00316.89
8.0.220.0040.00416.87
8.0.210.0000.00716.84
8.0.200.0060.00016.94
8.0.190.0030.00616.94
8.0.180.0000.00816.81
8.0.170.0030.00516.95
8.0.160.0030.00416.90
8.0.150.0070.00016.84
8.0.140.0040.00816.81
8.0.130.0000.00613.36
8.0.120.0040.00416.81
8.0.110.0040.00416.75
8.0.100.0040.00416.69
8.0.90.0000.00716.79
8.0.80.0090.01216.78
8.0.70.0040.00416.92
8.0.60.0060.00316.95
8.0.50.0000.00716.94
8.0.30.0080.01017.05
8.0.20.0120.00717.40
8.0.10.0040.00416.87
8.0.00.0100.00716.76
7.4.330.0000.00516.81
7.4.320.0000.00616.38
7.4.300.0000.00616.40
7.4.290.0000.00716.42
7.4.280.0000.00616.36
7.4.270.0000.00716.52
7.4.260.0030.00313.22
7.4.250.0040.00416.48
7.4.240.0030.00416.38
7.4.230.0000.00716.51
7.4.220.0070.01016.48
7.4.210.0040.01216.47
7.4.200.0030.00316.45
7.4.190.0040.00416.70
7.4.160.0080.01116.48
7.4.150.0140.00317.40
7.4.140.0120.00517.86
7.4.130.0120.00816.52
7.4.120.0100.00816.51
7.4.110.0070.01016.55
7.4.100.0100.00716.34
7.4.90.0170.00616.40
7.4.80.0090.00919.39
7.4.70.0090.00916.19
7.4.60.0060.01216.45
7.4.50.0000.00816.50
7.4.40.0100.00722.77
7.4.30.0100.00716.46
7.4.00.0070.00715.00
7.3.330.0050.00013.30
7.3.320.0000.00513.15
7.3.310.0070.00016.20
7.3.300.0030.00316.16
7.3.290.0070.00716.35
7.3.280.0070.00916.29
7.3.270.0040.01217.40
7.3.260.0080.00816.54
7.3.250.0060.01116.39
7.3.240.0110.00616.31
7.3.230.0080.00916.39
7.3.210.0090.00616.53
7.3.200.0090.01219.39
7.3.190.0110.01116.49
7.3.180.0070.01416.29
7.3.170.0000.01716.27
7.3.160.0090.00716.45
7.3.120.0000.01614.88
7.2.330.0090.00916.30
7.2.320.0080.00816.69
7.2.310.0130.00716.66
7.2.300.0110.01116.27
7.2.290.0110.00616.61
7.2.60.0090.00616.44
7.2.00.0100.00719.09
7.1.200.0060.00615.56
7.1.100.0190.00916.05
7.1.70.0050.00316.75
7.1.60.0120.01219.17
7.1.50.0070.01416.86
7.1.00.0100.02722.54
7.0.200.0030.00516.71
7.0.140.0000.07322.00
7.0.100.0070.08320.17
7.0.90.0370.08719.90
7.0.80.0370.05720.01
7.0.70.0370.05721.76
7.0.60.0070.09019.97
7.0.50.0070.08720.39
7.0.40.0100.08320.09
7.0.30.0100.07019.99
7.0.20.0030.09020.03
7.0.10.0070.04720.10
7.0.00.0070.08320.09
5.6.280.0130.06321.10
5.6.250.0070.06720.70
5.6.240.0130.07320.58
5.6.230.0100.05020.66
5.6.220.0170.07720.48
5.6.210.0070.08720.68
5.6.200.0130.07021.17
5.6.190.0130.07721.09
5.6.180.0100.08020.95
5.6.170.0030.05321.09
5.6.160.0070.08320.94
5.6.150.0100.08021.02
5.6.140.0070.08321.02
5.6.130.0030.05320.96
5.6.120.0130.07321.08
5.6.110.0100.06321.08
5.6.100.0070.08720.99
5.6.90.0070.08721.02
5.6.80.0100.06720.41
5.6.70.0100.08020.52
5.6.60.0000.06320.34
5.6.50.0030.04020.49
5.6.40.0130.07020.41
5.6.30.0000.04320.30
5.6.20.0070.03720.53
5.6.10.0030.04020.46
5.6.00.0070.03720.37
5.5.380.0100.07020.42
5.5.370.0000.08720.36
5.5.360.0070.08720.36
5.5.350.0100.07320.43
5.5.340.0130.05720.91
5.5.330.0030.08320.84
5.5.320.0000.05720.85
5.5.310.0100.04320.65
5.5.300.0100.07720.89
5.5.290.0130.07320.84
5.5.280.0230.06320.77
5.5.270.0030.07720.92
5.5.260.0130.05720.64
5.5.250.0100.07020.68
5.5.240.0030.07320.26
5.5.230.0100.07720.12
5.5.220.0100.04020.28
5.5.210.0070.06320.12
5.5.200.0100.03320.14
5.5.190.0000.04320.12
5.5.180.0070.04720.09
5.5.160.0070.03720.27
5.5.150.0000.04320.24
5.5.140.0100.03320.24
5.5.130.0070.03320.27
5.5.120.0000.05320.15
5.5.110.0100.03720.17
5.5.100.0030.04320.14
5.5.90.0030.04320.17
5.5.80.0070.04020.09
5.5.70.0000.06720.11
5.5.60.0030.04020.15
5.5.50.0030.04019.97
5.5.40.0070.06020.00
5.5.30.0030.04320.14
5.5.20.0030.04019.96
5.5.10.0070.06020.05
5.5.00.0070.03720.06
5.4.450.0170.05719.38
5.4.440.0070.08019.41
5.4.430.0030.08019.46
5.4.420.0030.07719.37
5.4.410.0000.09019.14
5.4.400.0070.04319.04
5.4.390.0130.07718.90
5.4.380.0100.03319.04
5.4.370.0030.04319.12
5.4.360.0030.04018.95
5.4.350.0100.05019.05
5.4.340.0030.08019.03
5.4.320.0070.04018.95
5.4.310.0030.04719.02
5.4.300.0000.04019.15
5.4.290.0130.03719.04
5.4.280.0070.06019.17
5.4.270.0030.05718.95
5.4.260.0070.03719.12
5.4.250.0000.04018.87
5.4.240.0030.03318.89
5.4.230.0070.03719.03
5.4.220.0100.02718.84
5.4.210.0030.04319.16
5.4.200.0070.03018.89
5.4.190.0000.04019.12
5.4.180.0070.03719.08
5.4.170.0030.06319.11
5.4.160.0130.02718.88
5.4.150.0000.04319.20
5.4.140.0030.03716.38
5.4.130.0000.03716.40
5.4.120.0000.03716.28
5.4.110.0000.03716.45
5.4.100.0000.04016.35
5.4.90.0000.04316.36
5.4.80.0070.02716.31
5.4.70.0070.07716.41
5.4.60.0030.07016.37
5.4.50.0030.07316.48
5.4.40.0170.02316.51
5.4.30.0070.07316.26
5.4.20.0070.06316.33
5.4.10.0070.07016.48
5.4.00.0000.04715.82
5.3.290.0070.05314.73
5.3.280.0030.08014.71
5.3.270.0030.03714.56
5.3.260.0070.04314.59
5.3.250.0030.03714.72
5.3.240.0070.03314.60
5.3.230.0070.03714.61
5.3.220.0030.03714.52
5.3.210.0030.04714.56
5.3.200.0000.04014.57
5.3.190.0070.05714.60
5.3.180.0000.06314.68
5.3.170.0000.04014.68
5.3.160.0100.07014.58
5.3.150.0070.07714.63
5.3.140.0100.06314.67
5.3.130.0030.07714.67
5.3.120.0070.08014.50
5.3.110.0030.07014.57
5.3.100.0070.07714.16
5.3.90.0070.07014.00
5.3.80.0000.07314.04
5.3.70.0100.06714.13
5.3.60.0000.07714.01
5.3.50.0030.07313.86
5.3.40.0070.05713.89
5.3.30.0070.07014.04
5.3.20.0070.07013.69
5.3.10.0030.07713.75
5.3.00.0100.07013.66
5.2.170.0030.05011.62
5.2.160.0030.05711.62
5.2.150.0030.05311.62
5.2.140.0030.06311.62
5.2.130.0030.05011.62
5.2.120.0000.04711.62
5.2.110.0030.06011.62
5.2.100.0070.05711.62
5.2.90.0100.05711.62
5.2.80.0030.06311.62
5.2.70.0000.06711.62
5.2.60.0030.06711.62
5.2.50.0070.05711.62
5.2.40.0070.05311.62
5.2.30.0030.06011.62
5.2.20.0100.05711.62
5.2.10.0070.03311.62
5.2.00.0030.06311.62
5.1.60.0030.05311.62
5.1.50.0030.05311.62
5.1.40.0070.04711.62
5.1.30.0070.05711.62
5.1.20.0000.06011.62
5.1.10.0070.04311.62
5.1.00.0070.05011.62
5.0.50.0030.04711.62
5.0.40.0030.04311.62
5.0.30.0030.06011.62
5.0.20.0070.04011.62
5.0.10.0030.04311.62
5.0.00.0100.05711.62
4.4.90.0000.03311.62
4.4.80.0030.03311.62
4.4.70.0030.02711.62
4.4.60.0070.02011.62
4.4.50.0030.03011.62
4.4.40.0000.05311.62
4.4.30.0070.02711.62
4.4.20.0030.02011.62
4.4.10.0000.02011.62
4.4.00.0000.03711.62
4.3.110.0070.03311.62
4.3.100.0030.03011.62
4.3.90.0000.02711.62
4.3.80.0000.04711.62
4.3.70.0030.02711.62
4.3.60.0100.02311.62
4.3.50.0000.02311.62
4.3.40.0070.04711.62
4.3.30.0000.03711.62
4.3.20.0000.03711.62
4.3.10.0000.02011.62
4.3.00.0070.02011.62

preferences:
44.26 ms | 401 KiB | 5 Q