3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ObjectFeature { public function __construct($object); } interface ObjectHasFeatures { public function addFeature($feature); public function getFeature($class); public function hasFeature($class); } trait HasFeatures { private $_hasfeatures_features = []; public function addFeature($class) { $this->_hasfeatures_features[$class] = new $class($this); } public function getFeature($class) { return $this->_hasfeatures_features[$class]; } public function hasFeature($class) { return isset($this->_hasfeatures_features[$class]); } } class Car implements ObjectHasFeatures { use HasFeatures; private $name; public function __construct($name) { $this->name = $name; } public function getName() { return $this->name; } } class FlyingFeature implements ObjectFeature { private $car; public function __construct($object) { assert($object instanceof Car); $this->car = $object; } public function fly() { echo "*{$this->car->getName()} starts flying*\n"; } } $car = new Car("Notion's Car"); $car->addFeature(FlyingFeature::class); $car->getFeature(FlyingFeature::class)->fly();

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.5.10.0090.01219.50
8.5.00.0130.00820.11
8.4.160.0140.00723.94
8.4.150.0020.00014.05
8.4.140.0120.00917.71
8.4.130.0050.00517.89
8.4.120.0090.01320.84
8.4.110.0120.00718.55
8.4.100.0100.00817.86
8.4.90.0130.00820.58
8.4.80.0060.00218.61
8.4.70.0080.01118.96
8.4.60.0090.01218.88
8.4.50.0130.00818.70
8.4.40.0090.01019.41
8.4.30.0100.01017.66
8.4.20.0060.00317.66
8.4.10.0050.00519.59
8.3.280.0100.01018.52
8.3.270.0100.00916.75
8.3.260.0080.01016.64
8.3.250.0130.00518.96
8.3.240.0130.00516.57
8.3.230.0040.00416.87
8.3.220.0120.00619.10
8.3.210.0060.00318.56
8.3.200.0060.00416.77
8.3.190.0100.00917.27
8.3.180.0050.00318.91
8.3.170.0030.01218.61
8.3.160.0070.00717.20
8.3.150.0090.00917.26
8.3.140.0080.00016.87
8.3.130.0090.00016.59
8.3.120.0060.00618.76
8.3.110.0050.00520.94
8.3.100.0080.00016.50
8.3.90.0040.00418.43
8.3.80.0030.00617.97
8.3.70.0090.00618.18
8.3.60.0060.00916.88
8.3.50.0010.01921.95
8.3.40.0070.00718.97
8.3.30.0110.00418.79
8.3.20.0040.00421.72
8.3.10.0000.00722.05
8.3.00.0040.00419.91
8.2.290.0080.00916.71
8.2.280.0110.00818.43
8.2.270.0070.01117.37
8.2.260.0100.00316.55
8.2.250.0100.01018.62
8.2.240.0160.00717.22
8.2.230.0080.00022.58
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0060.00316.63
8.2.190.0090.00616.63
8.2.180.0100.01018.54
8.2.170.0000.01422.96
8.2.160.0150.00022.96
8.2.150.0040.00424.18
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0000.00819.66
8.2.110.0040.00721.11
8.2.100.0000.01117.76
8.2.90.0000.00919.23
8.2.80.0040.00417.97
8.2.70.0060.00317.75
8.2.60.0080.00018.03
8.2.50.0030.00518.10
8.2.40.0040.00420.55
8.2.30.0080.00019.35
8.2.20.0040.00418.21
8.2.10.0050.00318.18
8.2.00.0000.00717.74
8.1.330.0060.00416.03
8.1.320.0040.00617.78
8.1.310.0110.00716.46
8.1.300.0050.00518.44
8.1.290.0040.00430.84
8.1.280.0060.01225.92
8.1.270.0040.00423.99
8.1.260.0030.00526.35
8.1.250.0000.00728.09
8.1.240.0040.01823.92
8.1.230.0040.00717.89
8.1.220.0040.00417.77
8.1.210.0030.00518.77
8.1.200.0030.00617.25
8.1.190.0060.00317.48
8.1.180.0000.00818.10
8.1.170.0040.00418.64
8.1.160.0050.00318.96
8.1.150.0040.00422.08
8.1.140.0070.00019.52
8.1.130.0000.00719.04
8.1.120.0070.00017.48
8.1.110.0080.00017.47
8.1.100.0000.00817.46
8.1.90.0000.00717.54
8.1.80.0000.00717.37
8.1.70.0040.00417.39
8.1.60.0040.00417.54
8.1.50.0000.00817.44
8.1.40.0000.00817.58
8.1.30.0000.00817.68
8.1.20.0050.00317.63
8.1.10.0070.00017.52
8.1.00.0000.00717.61
8.0.300.0050.00518.77
8.0.290.0050.00316.88
8.0.280.0030.00318.53
8.0.270.0070.00017.34
8.0.260.0090.00017.38
8.0.250.0040.00417.00
8.0.240.0080.00016.98
8.0.230.0030.00716.98
8.0.220.0000.00716.88
8.0.210.0070.00016.78
8.0.200.0070.00016.99
8.0.190.0040.00417.00
8.0.180.0040.00416.98
8.0.170.0070.00016.95
8.0.160.0000.00816.81
8.0.150.0040.00416.96
8.0.140.0000.00716.85
8.0.130.0000.00713.32
8.0.120.0000.00816.91
8.0.110.0040.00416.78
8.0.100.0040.00416.98
8.0.90.0040.00417.00
8.0.80.0110.00517.05
8.0.70.0000.00816.95
8.0.60.0020.00516.86
8.0.50.0030.00516.77
8.0.30.0070.01117.11
8.0.20.0090.01017.40
8.0.10.0050.00217.13
8.0.00.0130.01017.02
7.4.330.0070.00015.55
7.4.320.0030.00316.45
7.4.300.0060.00016.57
7.4.290.0030.00316.43
7.4.280.0050.00516.62
7.4.270.0030.00316.52
7.4.260.0030.00316.51
7.4.250.0000.00716.42
7.4.240.0070.00016.46
7.4.230.0000.00716.73
7.4.220.0140.00416.63
7.4.210.0100.00716.63
7.4.200.0030.00316.60
7.4.160.0120.00916.49
7.4.150.0030.01417.40
7.4.140.0130.01017.86
7.4.130.0060.01016.60
7.4.120.0040.01316.56
7.4.110.0100.01316.68
7.4.100.0100.00716.65
7.4.90.0110.00716.43
7.4.80.0150.00619.39
7.4.70.0060.01316.55
7.4.60.0080.01216.65
7.4.50.0110.00716.56
7.4.40.0110.00516.52
7.4.30.0060.01216.57
7.4.10.0000.01815.08
7.4.00.0080.00915.11
7.3.330.0060.00013.24
7.3.320.0070.00013.35
7.3.310.0000.00716.42
7.3.300.0030.00316.39
7.3.290.0080.00616.47
7.3.280.0080.00916.48
7.3.270.0180.00017.40
7.3.260.0070.01016.39
7.3.250.0100.00916.55
7.3.240.0120.00616.46
7.3.230.0090.00716.60
7.3.210.0060.01616.66
7.3.200.0000.01816.49
7.3.190.0160.00016.43
7.3.180.0120.00416.48
7.3.170.0070.01016.53
7.3.160.0130.00316.58
7.3.130.0110.00614.65
7.3.120.0050.01214.71
7.3.110.0110.00614.89
7.3.100.0080.00614.89
7.3.90.0060.00814.89
7.3.80.0040.00614.92
7.3.70.0050.00914.91
7.3.60.0080.00814.92
7.3.50.0060.00914.88
7.3.40.0020.01114.71
7.3.30.0110.00314.86
7.3.20.0080.00616.79
7.3.10.0060.00916.62
7.3.00.0070.00516.66
7.2.330.0090.00916.78
7.2.320.0060.01616.60
7.2.310.0110.00716.79
7.2.300.0100.01316.41
7.2.290.0090.00916.81
7.2.260.0120.00915.01
7.2.250.0060.01215.05
7.2.240.0020.01315.02
7.2.230.0060.00915.23
7.2.220.0050.01015.04
7.2.210.0020.01115.23
7.2.200.0030.01314.94
7.2.190.0040.01015.18
7.2.180.0070.00714.99
7.2.170.0050.01015.09
7.2.160.0000.01314.98
7.2.150.0080.00416.86
7.2.140.0100.00317.02
7.2.130.0040.01116.90
7.2.120.0070.00716.89
7.2.110.0070.00716.92
7.2.100.0050.00517.00
7.2.90.0050.00416.95
7.2.80.0100.00316.73
7.2.70.0080.00816.90
7.2.60.0050.00716.86
7.2.50.0080.00716.95
7.2.40.0090.00616.89
7.2.30.0090.00616.76
7.2.20.0130.00317.15
7.2.10.0040.01116.90
7.2.00.0130.00617.00
7.1.330.0030.01015.84
7.1.320.0030.00615.83
7.1.310.0060.00715.66
7.1.300.0070.00715.62
7.1.290.0020.00815.71
7.1.280.0050.00815.61
7.1.270.0090.00515.82
7.1.260.0050.00715.55
7.1.250.0090.00315.71
7.1.240.0060.00615.92
7.1.230.0000.01015.82
7.1.220.0060.00315.73
7.1.210.0030.00715.67
7.1.200.0040.00515.75
7.1.190.0000.01715.92
7.1.180.0070.00315.74
7.1.170.0030.00715.98
7.1.160.0070.01015.82
7.1.150.0040.00715.69
7.1.140.0080.00815.88
7.1.130.0040.00415.83
7.1.120.0040.01115.90
7.1.110.0120.00315.83
7.1.100.0090.00315.91
7.1.90.0030.01015.95
7.1.80.0030.01015.80
7.1.70.0070.00316.47
7.1.60.0050.00716.62
7.1.50.0000.01216.05
7.1.40.0040.00815.63
7.1.30.0040.01215.98
7.1.20.0000.01315.76
7.1.10.0090.03218.97
7.1.00.0060.03419.08
7.0.330.0060.00615.18
7.0.320.0070.00715.26
7.0.310.0060.00615.50
7.0.300.0030.00615.32
7.0.290.0000.00915.19
7.0.280.0030.00915.21
7.0.270.0000.00815.46
7.0.260.0090.00915.46
7.0.250.0070.01115.55
7.0.240.0070.00715.33
7.0.230.0040.01115.43
7.0.220.0040.01115.39
7.0.210.0080.00515.29
7.0.200.0030.01215.94
7.0.190.0040.00715.46
7.0.180.0030.01015.59
7.0.170.0030.01015.64
7.0.160.0040.01115.41
7.0.150.0050.03318.70
7.0.140.0070.03418.59
7.0.130.0100.03018.68
7.0.120.0070.03318.68
7.0.110.0070.03418.54
7.0.100.0090.02618.58
7.0.90.0070.03218.69
7.0.80.0030.03518.77
7.0.70.0080.03318.71
7.0.60.0100.03118.65
7.0.50.0100.02818.65
7.0.40.0080.02817.71
7.0.30.0100.03017.69
7.0.20.0050.03517.66
7.0.10.0050.03117.59
7.0.00.0010.04617.61
5.6.400.0030.01014.49
5.6.390.0090.00014.41
5.6.380.0000.01214.66
5.6.370.0040.01414.42
5.6.360.0070.00714.61
5.6.350.0000.00914.64
5.6.340.0040.00814.48
5.6.330.0080.00014.45
5.6.320.0070.01014.63
5.6.310.0040.01414.66
5.6.300.0040.00814.57
5.6.290.0000.01314.48
5.6.280.0060.00914.67
5.6.270.0040.01114.48
5.6.260.0000.00914.34
5.6.250.0050.00514.60
5.6.240.0110.00414.64
5.6.230.0030.01014.46
5.6.220.0060.00914.52
5.6.210.0080.00614.68
5.6.200.0000.01414.48
5.6.190.0070.00714.69
5.6.180.0100.00714.58
5.6.170.0030.00614.55
5.6.160.0040.01114.45
5.6.150.0090.00614.29
5.6.140.0060.00614.46
5.6.130.0070.00314.20
5.6.120.0080.00414.40
5.6.110.0070.00314.54
5.6.100.0090.00014.43
5.6.90.0160.00014.36
5.6.80.0000.00914.57
5.6.70.0100.00614.36
5.6.60.0070.00714.40
5.6.50.0060.00314.09
5.6.40.0090.00614.59
5.6.30.0100.00314.35
5.6.20.0040.00814.43
5.6.10.0030.01014.30
5.6.00.0000.00914.30

preferences:
167.84 ms | 403 KiB | 5 Q