3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test { trait Base { public $config = []; function __construct($config = []) { $this->config = $config; } } trait ConfigTrait { use Base; } } namespace { class Config { use Test\ConfigTrait; } $test = new Config(['foo' => 'bar']); echo isset($test->config['foo']) ? 'Success: foo is set' : 'Error: foo is not set'; }

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.01118.47
8.3.50.0070.00717.90
8.3.40.0050.00918.61
8.3.30.0070.00718.52
8.3.20.0040.00420.85
8.3.10.0040.00423.48
8.3.00.0040.00421.75
8.2.180.0110.00718.54
8.2.170.0090.00622.96
8.2.160.0070.00721.92
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00420.35
8.2.120.0060.00326.35
8.2.110.0060.00320.39
8.2.100.0080.00417.91
8.2.90.0040.00417.75
8.2.80.0050.00718.57
8.2.70.0040.00417.50
8.2.60.0130.00017.75
8.2.50.0040.00417.61
8.2.40.0050.00319.88
8.2.30.0000.00819.30
8.2.20.0040.00418.04
8.2.10.0070.00019.24
8.2.00.0040.00419.41
8.1.280.0100.01025.92
8.1.270.0030.00618.87
8.1.260.0070.00326.35
8.1.250.0070.00028.09
8.1.240.0100.00023.73
8.1.230.0030.00820.99
8.1.220.0080.00018.57
8.1.210.0030.00618.77
8.1.200.0050.00317.35
8.1.190.0030.00617.13
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0000.00718.95
8.1.150.0000.00718.83
8.1.140.0030.00322.04
8.1.130.0030.00320.18
8.1.120.0040.00417.30
8.1.110.0070.00017.34
8.1.100.0070.00017.42
8.1.90.0070.00017.46
8.1.80.0040.00417.40
8.1.70.0000.01117.30
8.1.60.0080.00017.55
8.1.50.0000.00717.52
8.1.40.0030.00617.54
8.1.30.0030.00617.50
8.1.20.0000.00817.68
8.1.10.0030.00617.43
8.1.00.0080.00017.50
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0000.00718.44
8.0.270.0020.00517.29
8.0.260.0000.00618.48
8.0.250.0000.00716.86
8.0.240.0060.00316.84
8.0.230.0000.00716.89
8.0.220.0030.00316.93
8.0.210.0000.00816.83
8.0.200.0000.00716.83
8.0.190.0070.00016.83
8.0.180.0000.00816.88
8.0.170.0030.00616.95
8.0.160.0030.00617.00
8.0.150.0000.01116.87
8.0.140.0000.00816.84
8.0.130.0030.00313.26
8.0.120.0040.00416.68
8.0.110.0070.00016.70
8.0.100.0040.00416.95
8.0.90.0030.00416.93
8.0.80.0050.01016.86
8.0.70.0000.00816.75
8.0.60.0080.00016.80
8.0.50.0000.00716.71
8.0.30.0090.01016.96
8.0.20.0090.01017.40
8.0.10.0040.00417.05
8.0.00.0150.00316.87
7.4.330.0000.00616.79
7.4.320.0030.00316.56
7.4.300.0000.00716.39
7.4.290.0030.00316.44
7.4.280.0000.00716.59
7.4.270.0070.00016.49
7.4.260.0070.00316.57
7.4.250.0030.00316.45
7.4.240.0040.00416.58
7.4.230.0030.00316.64
7.4.220.0000.00816.52
7.4.210.0030.01116.50
7.4.200.0030.00316.49
7.4.160.0050.01216.45
7.4.140.0080.01317.86
7.4.130.0090.00916.41
7.4.120.0080.00816.61
7.4.110.0110.01116.32
7.4.100.0030.01716.42
7.4.90.0100.00716.58
7.4.80.0100.00719.39
7.4.70.0120.00316.40
7.4.60.0100.00616.44
7.4.50.0040.01416.48
7.4.40.0000.01616.48
7.4.00.0070.00714.94
7.3.330.0050.00013.07
7.3.320.0030.00313.18
7.3.310.0040.00416.16
7.3.300.0070.00016.11
7.3.290.0000.00716.29
7.3.280.0060.01116.22
7.3.260.0090.00916.33
7.3.240.0100.00916.42
7.3.230.0150.00616.27
7.3.210.0110.00716.44
7.3.200.0100.00716.38
7.3.190.0130.01016.37
7.3.180.0060.01016.52
7.3.170.0140.00616.29
7.3.160.0110.00616.55
7.3.10.0040.01116.52
7.3.00.0120.00515.35
7.2.330.0120.00616.71
7.2.320.0160.00616.42
7.2.310.0030.01216.50
7.2.300.0140.00316.39
7.2.290.0060.01216.67
7.2.130.1380.00715.80
7.2.120.0670.00315.81
7.2.110.0090.00815.59
7.2.100.0050.01215.57
7.2.90.0020.01015.74
7.2.80.0450.00815.92
7.2.70.0240.00615.72
7.2.60.0070.00815.79
7.2.50.0070.00715.84
7.2.40.5220.00915.86
7.2.30.0110.00515.93
7.2.20.5740.00615.93
7.2.10.7040.00915.70
7.2.00.6370.00815.96
7.1.250.1090.00614.71
7.0.330.0130.00313.04
5.6.380.0060.00914.17

preferences:
64.6 ms | 401 KiB | 5 Q