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; } } class asdf {} 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.0130.00618.40
8.3.50.0140.00821.21
8.3.40.0090.00618.49
8.3.30.0100.00320.27
8.3.20.0040.00420.21
8.3.10.0000.00821.89
8.3.00.0040.00422.43
8.2.180.0080.00816.38
8.2.170.0110.00422.96
8.2.160.0100.00722.12
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0070.00020.79
8.2.110.0030.00620.56
8.2.100.0040.00817.62
8.2.90.0060.00319.14
8.2.80.0070.00019.39
8.2.70.0060.00317.63
8.2.60.0040.00417.79
8.2.50.0000.00818.07
8.2.40.0080.00018.05
8.2.30.0060.00319.44
8.2.20.0050.00217.71
8.2.10.0000.00717.55
8.2.00.0000.00817.78
8.1.280.0070.01025.92
8.1.270.0080.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.97
8.1.230.0000.01122.07
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0050.00317.28
8.1.180.0000.00818.10
8.1.170.0000.00918.65
8.1.160.0000.00718.82
8.1.150.0040.00418.57
8.1.140.0070.00017.46
8.1.130.0070.00017.75
8.1.120.0030.00617.27
8.1.110.0040.00417.28
8.1.100.0070.00017.42
8.1.90.0040.00417.27
8.1.80.0020.00517.28
8.1.70.0070.00017.41
8.1.60.0060.00317.52
8.1.50.0060.00317.46
8.1.40.0000.00817.48
8.1.30.0000.00717.51
8.1.20.0000.00817.48
8.1.10.0000.00717.36
8.1.00.0060.00317.21
8.0.300.0030.00618.77
8.0.290.0040.00417.05
8.0.280.0030.00318.49
8.0.270.0050.00317.23
8.0.260.0000.00816.80
8.0.250.0000.00716.87
8.0.240.0000.01016.88
8.0.230.0070.00016.93
8.0.220.0030.00316.91
8.0.210.0000.00716.95
8.0.200.0030.00316.82
8.0.190.0030.00616.82
8.0.180.0050.00316.80
8.0.170.0000.00816.84
8.0.160.0000.00816.91
8.0.150.0000.00816.72
8.0.140.0070.00316.91
8.0.130.0060.00013.34
8.0.120.0020.00516.73
8.0.110.0030.00516.78
8.0.100.0000.00816.88
8.0.90.0000.00816.93
8.0.80.0100.01016.88
8.0.70.0040.00416.91
8.0.60.0000.00716.89
8.0.50.0040.00416.85
8.0.30.0060.01217.12
8.0.20.0100.01217.40
8.0.10.0040.00416.85
8.0.00.0110.01116.65
7.4.330.0000.00516.89
7.4.320.0030.00316.45
7.4.300.0060.00016.36
7.4.290.0000.00716.45
7.4.280.0030.00516.50
7.4.270.0030.00316.59
7.4.260.0000.00513.32
7.4.250.0030.00716.45
7.4.240.0020.00516.43
7.4.230.0030.00516.52
7.4.220.0090.01316.64
7.4.210.0110.00716.58
7.4.200.0000.00716.24
7.4.190.0070.00016.67
7.4.160.0120.00416.65
7.4.150.0070.01017.40
7.4.140.0120.00817.86
7.4.130.0120.00616.33
7.4.120.0070.01016.49
7.4.110.0120.00416.45
7.4.100.0030.01316.33
7.4.90.0060.01516.61
7.4.80.0030.01419.39
7.4.70.0140.00316.36
7.4.60.0160.00616.45
7.4.50.0030.00516.27
7.4.40.0060.00922.77
7.4.30.0140.00316.23
7.4.10.0090.00916.56
7.4.00.0070.01115.75
7.3.330.0000.00513.19
7.3.320.0050.00013.23
7.3.310.0030.00316.18
7.3.300.0030.00316.27
7.3.290.0090.00616.18
7.3.280.0070.00916.23
7.3.270.0160.00017.40
7.3.260.0120.00416.37
7.3.250.0100.00616.31
7.3.240.0110.00716.53
7.3.230.0030.01316.39
7.3.210.0100.00716.42
7.3.200.0030.01319.39
7.3.190.0090.01216.36
7.3.180.0130.00316.44
7.3.170.0130.00916.45
7.3.160.0070.01416.32
7.3.130.0070.01416.34
7.3.120.0050.01015.44
7.3.110.0070.00716.28
7.3.100.0070.00716.14
7.3.90.0070.00316.38
7.3.80.0060.00916.19
7.3.70.0070.00716.23
7.3.60.0030.00616.42
7.3.50.0030.01416.22
7.3.40.0110.00416.29
7.3.30.0030.01516.22
7.3.20.0130.00318.16
7.3.10.0050.00716.87
7.3.00.0060.00816.91
7.2.330.0090.00916.68
7.2.320.0100.01316.61
7.2.310.0110.01216.54
7.2.300.0030.01316.43
7.2.290.0100.01316.68
7.2.260.0130.00916.30
7.2.250.0120.00316.51
7.2.240.0070.01116.32
7.2.230.0100.00316.25
7.2.220.0090.00916.49
7.2.210.0030.01216.51
7.2.200.0090.00616.56
7.2.190.0080.00816.33
7.2.180.0030.01016.36
7.2.170.0120.00016.35
7.2.160.0070.01016.47
7.2.150.0080.00418.21
7.2.140.0070.01018.34
7.2.130.0110.00417.30
7.2.120.0040.00717.23
7.2.110.0070.00917.19
7.2.100.0080.00717.05
7.2.90.0040.00917.36
7.2.80.0040.01017.09
7.2.70.0050.01217.17
7.2.60.0030.01017.05
7.2.50.0060.00717.21
7.2.40.0050.01117.02
7.2.30.0090.00517.28
7.2.20.0080.00417.21
7.2.10.0130.00816.98
7.2.00.0090.00717.75
7.1.330.0090.00317.36
7.1.320.0060.01217.27
7.1.310.0090.00617.30
7.1.300.0100.00717.05
7.1.290.0140.00017.12
7.1.280.0040.01417.31
7.1.270.0030.00917.14
7.1.260.0070.00717.09
7.1.250.0060.00815.98
7.1.240.0140.00017.26
7.1.230.0030.00617.09
7.1.220.0040.01217.30
7.1.210.0070.00317.06
7.1.200.0100.00316.33
7.1.190.0000.01517.15
7.1.180.0110.00417.01
7.1.170.0030.01017.14
7.1.160.0070.01017.31
7.1.150.0060.00917.11
7.1.140.0090.00317.16
7.1.130.0030.01017.24
7.1.120.0050.00517.07
7.1.110.0070.00717.18
7.1.100.0070.00917.38
7.1.90.0090.00617.20
7.1.80.0040.01117.18
7.1.70.0070.00516.96
7.1.60.0100.00918.18
7.1.50.0070.01217.01
7.1.40.0090.00617.17
7.1.30.0060.00917.09
7.1.20.0000.01617.27
7.1.10.0060.00617.04
7.1.00.0080.03519.77
7.0.330.0080.00816.96
7.0.320.0040.01116.87
7.0.310.0090.00916.65
7.0.300.0040.01217.09
7.0.290.0070.00716.97
7.0.280.0030.01017.02
7.0.270.0030.01316.73
7.0.260.0050.00516.81
7.0.250.0040.01116.88
7.0.240.0070.01116.77
7.0.230.0030.01016.93
7.0.220.0030.00917.04
7.0.210.0060.00916.78
7.0.200.0040.00716.61
7.0.190.0060.00616.78
7.0.180.0030.00716.97
7.0.170.0000.01017.00
7.0.160.0090.00616.73
7.0.150.0030.00716.81
7.0.140.0050.04119.46
7.0.130.0030.00916.79
7.0.120.0060.01217.04
7.0.110.0030.01216.86
7.0.100.0070.03018.35
7.0.90.0020.02518.56
7.0.80.0030.03418.40
7.0.70.0050.02318.34
7.0.60.0080.04218.46
7.0.50.0200.02718.62
7.0.40.0050.02517.46
7.0.30.0050.02617.48
7.0.20.0040.04117.43
7.0.10.0050.02317.53
7.0.00.0070.04517.44
5.6.400.0060.00615.69
5.6.390.0070.01115.56
5.6.380.0120.00415.74
5.6.370.0040.01415.76
5.6.360.0070.01015.81
5.6.350.0120.00315.54
5.6.340.0030.01015.93
5.6.330.0070.00715.77
5.6.320.0070.00715.76
5.6.310.0090.00615.77
5.6.300.0030.00715.80
5.6.290.0030.00915.82
5.6.280.0030.04418.28
5.6.270.0130.00315.71
5.6.260.0140.00715.86
5.6.250.0080.02318.29
5.6.240.0030.02518.23
5.6.230.0050.02518.21
5.6.220.0080.03318.24
5.6.210.0050.04018.08
5.6.200.0080.04818.38
5.6.190.0070.02218.46
5.6.180.0150.03318.43
5.6.170.0030.05118.49
5.6.160.0040.04318.28
5.6.150.0150.03018.39
5.6.140.0050.04318.44
5.6.130.0030.04918.35
5.6.120.0020.05118.45
5.6.110.0030.04318.34
5.6.100.0110.03818.27
5.6.90.0080.03818.28
5.6.80.0070.04318.01
5.6.70.0090.03917.92
5.6.60.0060.03917.95
5.6.50.0030.04718.04
5.6.40.0070.04517.94
5.6.30.0090.03718.08
5.6.20.0050.04418.02
5.6.10.0080.04018.05
5.6.00.0070.04518.05
5.5.380.0050.02418.05
5.5.370.0060.03118.02
5.5.360.0030.03017.98
5.5.350.0080.02717.91
5.5.340.0040.04318.11
5.5.330.0070.04318.32
5.5.320.0110.03818.33
5.5.310.0060.03818.20
5.5.300.0060.03818.34
5.5.290.0050.04718.19
5.5.280.0070.03818.33
5.5.270.0070.04518.31
5.5.260.0100.04018.24
5.5.250.0080.03918.13
5.5.240.0080.04017.91
5.5.230.0080.04017.82
5.5.220.0100.04117.74
5.5.210.0100.03817.95
5.5.200.0040.04317.86
5.5.190.0070.03717.88
5.5.180.0100.03617.86
5.5.170.0030.01015.73
5.5.160.0130.03017.91
5.5.150.0000.04417.95
5.5.140.0070.04317.71
5.5.130.0100.04318.00
5.5.120.0120.03717.79
5.5.110.0070.02717.87
5.5.100.0050.04617.84
5.5.90.0110.03417.93
5.5.80.0050.03017.82
5.5.70.0050.04017.75
5.5.60.0120.02417.76
5.5.50.0140.02217.82
5.5.40.0130.03317.88
5.5.30.0140.02417.78
5.5.20.0080.04317.75
5.5.10.0090.03617.77
5.5.00.0050.04417.75
5.4.450.0060.04316.26
5.4.440.0100.03016.41
5.4.430.0060.02516.38
5.4.420.0100.03816.36
5.4.410.0040.02416.35
5.4.400.0020.04716.16
5.4.390.0080.02816.07
5.4.380.0050.04316.21
5.4.370.0070.02316.26
5.4.360.0090.04016.23
5.4.350.0070.03216.16
5.4.340.0070.03316.16
5.4.330.0100.00313.29
5.4.320.0080.03616.26
5.4.310.0070.03716.09
5.4.300.0140.03216.19
5.4.290.0150.03316.21
5.4.280.0100.03716.15
5.4.270.0050.04216.21
5.4.260.0040.03616.19
5.4.250.0070.03616.08
5.4.240.0140.03316.24
5.4.230.0080.02516.21
5.4.220.0030.04316.25
5.4.210.0050.04216.12
5.4.200.0020.04916.15
5.4.190.0070.04016.08
5.4.180.0030.04516.25
5.4.170.0070.04216.15
5.4.160.0030.04516.11
5.4.150.0030.04216.24
5.4.140.0130.03314.81
5.4.130.0070.03514.78
5.4.120.0080.03414.84
5.4.110.0080.03414.80
5.4.100.0070.03714.81
5.4.90.0050.03714.89
5.4.80.0120.03314.90
5.4.70.0110.03314.86
5.4.60.0070.03814.85
5.4.50.0020.02614.87
5.4.40.0140.03314.84
5.4.30.0030.04214.80
5.4.20.0030.04214.76
5.4.10.0020.04114.86
5.4.00.0030.04614.57
5.3.290.0100.04014.01
5.3.280.0060.04513.93
5.3.270.0100.04113.96
5.3.260.0120.04014.01
5.3.250.0110.02713.98
5.3.240.0090.04214.00
5.3.230.0070.04414.00
5.3.220.0090.04313.94
5.3.210.0110.04113.92
5.3.200.0040.02713.91
5.3.190.0090.04213.90
5.3.180.0090.03613.98
5.3.170.0050.04613.92
5.3.160.0070.04213.89
5.3.150.0090.04113.99
5.3.140.0040.04413.99
5.3.130.0100.03813.89
5.3.120.0090.03913.91
5.3.110.0110.04213.95
5.3.100.0030.03113.65
5.3.90.0060.04213.63
5.3.80.0140.03513.66
5.3.70.0090.04313.70
5.3.60.0060.03013.67
5.3.50.0130.03913.63
5.3.40.0100.04213.63
5.3.30.0070.04113.63
5.3.20.0080.02713.56
5.3.10.0070.04213.46
5.3.00.0090.03813.43
5.2.170.0070.06011.14
5.2.160.0100.05711.05
5.2.150.0000.06711.06
5.2.140.0100.05711.16
5.2.130.0100.05311.09
5.2.120.0070.06310.94
5.2.110.0030.06311.14
5.2.100.0000.06711.10
5.2.90.0100.05311.10
5.2.80.0030.06311.09
5.2.70.0000.04010.88
5.2.60.0100.05310.84
5.2.50.0070.06010.86
5.2.40.0070.05710.81
5.2.30.0070.06010.97
5.2.20.0030.06310.81
5.2.10.0070.06310.81
5.2.00.0030.03710.73
5.1.60.0070.0539.87
5.1.50.0030.0539.99
5.1.40.0070.0539.96
5.1.30.0030.05710.34
5.1.20.0070.05710.22
5.1.10.0100.02710.11
5.1.00.0000.0539.91
5.0.50.0070.0408.70
5.0.40.0070.0438.70
5.0.30.0070.0638.70
5.0.20.0030.0478.70
5.0.10.0070.0338.70
5.0.00.0070.0538.70
4.4.90.0030.0338.70
4.4.80.0070.0308.70
4.4.70.0000.0378.70
4.4.60.0000.0378.70
4.4.50.0000.0408.70
4.4.40.0000.0478.70
4.4.30.0070.0338.70
4.4.20.0030.0338.70
4.4.10.0030.0338.70
4.4.00.0070.0508.70
4.3.110.0100.0278.70
4.3.100.0070.0308.70
4.3.90.0030.0338.70
4.3.80.0030.0508.70
4.3.70.0100.0278.70
4.3.60.0100.0308.70
4.3.50.0030.0308.70
4.3.40.0000.0408.70
4.3.30.0030.0338.70
4.3.20.0030.0338.70
4.3.10.0000.0378.70
4.3.00.0000.0338.70

preferences:
33.99 ms | 401 KiB | 5 Q