3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Globock { trait Test { function toTest() { return 'toTest mock'; } } } namespace Acme { use Globock\Test; class Foo { public function hello() { return toTest(); } } } namespace Acme\Test { use Acme\Foo; class FooTest { public function helloTest() { $a = new Foo(); echo $a->hello(); } } } namespace { function toTest() { return 'toTest'; } //$a = new Acme\Foo(); //echo $a->hello(); $b = new Acme\Test\FooTest(); $b->helloTest(); }

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.0060.00918.57
8.3.30.0060.00918.94
8.3.20.0000.00820.04
8.3.10.0040.00421.77
8.3.00.0000.00819.68
8.2.170.0170.00022.96
8.2.160.0100.00320.30
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0150.00426.16
8.2.120.0040.00421.04
8.2.110.0040.00422.07
8.2.100.0060.00617.78
8.2.90.0000.00819.22
8.2.80.0000.01017.97
8.2.70.0080.00417.63
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0000.00818.22
8.2.30.0000.00718.05
8.2.20.0040.00417.74
8.2.10.0040.00417.98
8.2.00.0040.00417.66
8.1.270.0040.00424.02
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0050.00523.96
8.1.230.0080.00318.81
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0070.00317.23
8.1.190.0030.00617.13
8.1.180.0050.00518.10
8.1.170.0040.00418.58
8.1.160.0040.00421.84
8.1.150.0000.00718.80
8.1.140.0050.00317.38
8.1.130.0070.00017.73
8.1.120.0040.00417.36
8.1.110.0040.00417.38
8.1.100.0000.00717.39
8.1.90.0040.00417.36
8.1.80.0080.00017.37
8.1.70.0030.00317.39
8.1.60.0080.00017.55
8.1.50.0000.00917.50
8.1.40.0000.00717.51
8.1.30.0060.00317.63
8.1.20.0000.00817.54
8.1.10.0040.00417.55
8.1.00.0020.00517.48
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.44
8.0.270.0070.00017.24
8.0.260.0030.00317.29
8.0.250.0030.00316.91
8.0.240.0070.00316.88
8.0.230.0050.00516.84
8.0.220.0040.00416.71
8.0.210.0030.00316.88
8.0.200.0030.00516.76
8.0.190.0030.00616.77
8.0.180.0050.00316.85
8.0.170.0040.00416.75
8.0.160.0040.00416.70
8.0.150.0000.00716.69
8.0.140.0050.00216.77
8.0.130.0000.00613.23
8.0.120.0000.00816.68
8.0.110.0040.00416.77
8.0.100.0070.00016.70
8.0.90.0040.00416.75
8.0.80.0190.00016.80
8.0.70.0000.00716.88
8.0.60.0000.00716.77
8.0.50.0070.00016.59
8.0.30.0040.01516.92
8.0.20.0100.00917.40
8.0.10.0040.00416.98
8.0.00.0080.01016.62
7.4.330.0000.00515.00
7.4.320.0000.00716.54
7.4.300.0030.00316.63
7.4.290.0040.00416.64
7.4.280.0040.00416.63
7.4.270.0000.00716.60
7.4.260.0000.00716.49
7.4.250.0040.00416.38
7.4.240.0030.00416.55
7.4.230.0000.00716.29
7.4.220.0030.01416.70
7.4.210.0040.01116.46
7.4.200.0000.00716.34
7.4.160.0090.00616.55
7.4.150.0170.00717.40
7.4.140.0090.00817.86
7.4.130.0080.00916.44
7.4.120.0100.00616.45
7.4.110.0090.01316.43
7.4.100.0160.00016.71
7.4.90.0060.01216.68
7.4.80.0120.01219.39
7.4.70.0040.01216.36
7.4.60.0130.00416.31
7.4.50.0060.00316.52
7.4.40.0030.01816.45
7.4.30.0060.01016.39
7.4.00.0050.01214.87
7.3.330.0030.00613.22
7.3.320.0030.00313.32
7.3.310.0000.00716.35
7.3.300.0000.00716.27
7.3.290.0110.00316.31
7.3.280.0080.00916.27
7.3.270.0090.00917.40
7.3.260.0170.00016.53
7.3.250.0140.00616.50
7.3.240.0060.01316.38
7.3.230.0160.00316.39
7.3.210.0080.00816.38
7.3.200.0130.00316.37
7.3.190.0090.00916.50
7.3.180.0060.01216.36
7.3.170.0070.01016.50
7.3.160.0080.00816.57
7.3.120.0110.00714.82
7.3.110.0120.00314.77
7.3.100.0020.01414.82
7.3.90.0050.01014.82
7.3.80.0040.00914.77
7.3.70.0020.01214.67
7.3.60.0030.01014.76
7.3.50.0090.00814.83
7.3.40.0020.01114.79
7.3.30.0080.00814.75
7.3.20.0070.00616.65
7.3.10.0070.00916.77
7.3.00.0020.01216.42
7.2.330.0080.00816.32
7.2.320.0110.00616.71
7.2.310.0000.01616.57
7.2.300.0060.01016.63
7.2.290.0030.01316.79
7.2.250.0070.01115.09
7.2.240.0080.01214.82
7.2.230.0050.01214.92
7.2.220.0110.00214.98
7.2.210.0070.00715.07
7.2.200.0080.00315.02
7.2.190.0070.00714.89
7.2.180.0000.01114.93
7.2.170.0090.00514.75
7.2.00.0120.00419.21
7.1.330.0050.00915.59
7.1.320.0090.00015.72
7.1.310.0070.00615.59
7.1.300.0120.00515.40
7.1.290.0050.00815.65
7.1.280.0080.00315.60
7.1.270.0060.00415.65
7.1.260.0040.01115.72
7.1.100.0000.01117.88
7.1.70.0000.01116.91
7.1.60.0030.02019.40
7.1.50.0060.01616.75
7.1.00.0070.07022.45
7.0.200.0000.00716.52
7.0.140.0070.06322.09
7.0.60.0000.06019.91
7.0.50.0130.08017.84
7.0.40.0230.06720.24
7.0.30.0270.04720.33
7.0.20.0200.07320.33
7.0.10.0030.09320.06
7.0.00.0100.06720.20
5.6.280.0000.07721.11
5.6.210.0070.07720.55
5.6.200.0130.08318.18
5.6.190.0030.04020.49
5.6.180.0300.07720.57
5.6.170.0300.04020.42
5.6.160.0100.07720.55
5.6.150.0070.08318.18
5.6.140.0000.05318.14
5.6.130.0030.04018.17
5.6.120.0070.03720.94
5.6.110.0030.04321.05
5.6.100.0130.03720.96
5.6.90.0030.09020.97
5.6.80.0030.07720.52
5.5.350.0370.04320.42
5.5.340.0170.05718.08
5.5.330.0100.03320.44
5.5.320.0430.07320.29
5.5.310.0200.04320.30
5.5.300.0030.08317.95
5.5.290.0070.08317.96
5.5.280.0100.08020.88
5.5.270.0130.07720.65
5.5.260.0100.07020.77
5.5.250.0070.08020.80
5.5.240.0130.07720.13
5.4.450.0300.04719.50
5.4.440.0430.05319.46
5.4.430.0270.05019.38
5.4.420.0330.04019.52
5.4.410.0370.03719.04
5.4.400.0270.03719.16
5.4.390.0300.04019.08
5.4.380.0370.05318.53
5.4.370.0370.05318.76
5.4.360.0270.05718.57
5.4.350.0300.06018.74
5.4.340.0400.05318.54
5.4.320.0080.03412.51
5.4.310.0050.03912.51
5.4.300.0060.03712.51
5.4.290.0060.04112.51
5.4.280.0050.03512.40
5.4.270.0030.04512.40
5.4.260.0060.04412.40
5.4.250.0070.03612.40
5.4.240.0070.03412.40
5.4.230.0100.04412.40
5.4.220.0080.03312.39
5.4.210.0060.03512.39
5.4.200.0060.03812.39
5.4.190.0070.03712.39
5.4.180.0050.03712.39
5.4.170.0070.04012.40
5.4.160.0030.03812.39
5.4.150.0050.03612.39
5.4.140.0040.03912.08
5.4.130.0050.03812.06
5.4.120.0080.03312.02
5.4.110.0050.04012.01
5.4.100.0030.04812.02
5.4.90.0030.04012.02
5.4.80.0080.04412.02
5.4.70.0060.03412.01
5.4.60.0020.03812.02
5.4.50.0060.03512.01
5.4.40.0070.03412.00
5.4.30.0080.03412.00
5.4.20.0090.03912.00
5.4.10.0080.03512.00
5.4.00.0070.03411.48
5.3.290.0070.03712.80
5.3.280.0100.04212.71
5.3.270.0070.03812.72
5.3.260.0080.04412.72
5.3.250.0090.03312.72
5.3.240.0090.03412.72
5.3.230.0090.03412.71
5.3.220.0070.03412.68
5.3.210.0080.03712.68
5.3.200.0060.03612.68
5.3.190.0080.03512.68
5.3.180.0050.03712.67
5.3.170.0070.03512.67
5.3.160.0080.03712.68
5.3.150.0050.03812.68
5.3.140.0060.03912.66
5.3.130.0050.04112.66
5.3.120.0060.04012.66
5.3.110.0050.04112.66
5.3.100.0060.03612.12
5.3.90.0040.04012.08
5.3.80.0070.03512.07
5.3.70.0080.03312.07
5.3.60.0060.03612.07
5.3.50.0040.03812.00
5.3.40.0070.03512.00
5.3.30.0070.03411.95
5.3.20.0050.03511.73
5.3.10.0040.04211.70
5.3.00.0040.04111.68
5.2.170.0030.0319.18
5.2.160.0040.0299.18
5.2.150.0040.0309.18
5.2.140.0050.0299.18
5.2.130.0010.0329.14
5.2.120.0060.0269.14
5.2.110.0050.0289.14
5.2.100.0050.0289.14
5.2.90.0070.0269.14
5.2.80.0020.0339.14
5.2.70.0060.0289.14
5.2.60.0060.0299.09
5.2.50.0050.0339.06
5.2.40.0060.0339.03
5.2.30.0020.0329.02
5.2.20.0040.0299.01
5.2.10.0050.0298.93
5.2.00.0020.0338.79
5.1.60.0020.0298.07
5.1.50.0030.0288.07
5.1.40.0040.0248.05
5.1.30.0030.0278.40
5.1.20.0060.0258.42
5.1.10.0050.0258.14
5.1.00.0030.0268.14
5.0.50.0050.0276.62
5.0.40.0060.0196.48
5.0.30.0040.0306.29
5.0.20.0010.0276.27
5.0.10.0040.0206.24
5.0.00.0030.0296.23
4.4.90.0040.0164.78
4.4.80.0030.0144.75
4.4.70.0010.0214.75
4.4.60.0010.0174.75
4.4.50.0010.0164.77
4.4.40.0040.0244.71
4.4.30.0020.0164.76
4.4.20.0010.0184.84
4.4.10.0020.0174.85
4.4.00.0020.0254.76
4.3.110.0050.0174.67
4.3.100.0040.0174.66
4.3.90.0010.0204.63
4.3.80.0020.0244.58
4.3.70.0070.0134.63
4.3.60.0030.0154.63
4.3.50.0020.0164.63
4.3.40.0010.0264.54
4.3.30.0010.0213.28
4.3.20.0020.0193.26
4.3.10.0010.0173.22
4.3.00.0130.02015.18

preferences:
39.86 ms | 400 KiB | 5 Q