3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Traverse\Test { interface MyTypeInterface { function getPropertyA(); function getPropertyB(); } class MyType implements MyTypeInterface { private $_propertyA; private $_propertyB; final public function getPropertyA() { return $this->_propertyA; } final public function getPropertyB() { return $this->_propertyB; } final private function setPropertyA($propertyA) { // $propertyA assertions $this->_propertyA = $propertyA; } final private function setPropertyB($propertyB) { // $propertyB assertions $this->_propertyB = $propertyB; } public function __construct(MyTypeInterface $myType) { $this->setPropertyA($myType->getPropertyA()); $this->setPropertyB($myType->getPropertyB()); } } class MyTypeBuilder implements MyTypeInterface { private $_propertyA; private $_propertyB; public function getPropertyA() { return $this->_propertyA; } public function setPropertyA($propertyA) { $this->_propertyA = $propertyA; } public function getPropertyB() { return $this->_propertyB; } public function setPropertyB($propertyB) { $this->_propertyB = $propertyB; } } $myTypeBuilder = new MyTypeBuilder(); $myTypeBuilder->setPropertyA('foo'); $myTypeBuilder->setPropertyB('bar'); $myType = new MyType($myTypeBuilder); var_dump($myTypeBuilder, $myType); /* object(Traverse\Test\MyTypeBuilder)#1 (2) { ["_propertyA":"Traverse\Test\MyTypeBuilder":private]=> string(3) "foo" ["_propertyB":"Traverse\Test\MyTypeBuilder":private]=> string(3) "bar" } object(Traverse\Test\MyType)#2 (2) { ["_propertyA":"Traverse\Test\MyType":private]=> string(3) "foo" ["_propertyB":"Traverse\Test\MyType":private]=> string(3) "bar" } */ }

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.43
8.3.50.0100.00822.05
8.3.40.0090.00618.88
8.3.30.0100.01019.17
8.3.20.0040.00420.16
8.3.10.0090.00022.26
8.3.00.0060.00322.34
8.2.180.0060.01216.75
8.2.170.0180.00419.08
8.2.160.0200.00022.96
8.2.150.0050.00325.66
8.2.140.0090.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.36
8.2.110.0030.00722.04
8.2.100.0070.00417.78
8.2.90.0050.00317.84
8.2.80.0040.00417.97
8.2.70.0070.00317.35
8.2.60.0030.00617.93
8.2.50.0060.00318.07
8.2.40.0050.00318.34
8.2.30.0040.00418.07
8.2.20.0030.00517.66
8.2.10.0000.00717.69
8.2.00.0000.00817.56
8.1.280.0040.01125.92
8.1.270.0030.00621.81
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0060.00322.46
8.1.230.0080.00420.91
8.1.220.0030.00617.77
8.1.210.0040.00419.04
8.1.200.0030.00617.38
8.1.190.0040.00417.53
8.1.180.0080.00018.67
8.1.170.0060.00318.65
8.1.160.0000.00721.93
8.1.150.0000.00718.56
8.1.140.0040.00417.42
8.1.130.0000.00817.86
8.1.120.0000.00717.36
8.1.110.0000.00717.38
8.1.100.0040.00417.42
8.1.90.0000.00717.50
8.1.80.0070.00017.43
8.1.70.0000.00717.46
8.1.60.0030.00517.48
8.1.50.0020.00517.41
8.1.40.0000.00817.56
8.1.30.0040.00417.62
8.1.20.0090.00017.67
8.1.10.0040.00417.46
8.1.00.0040.00417.49
8.0.300.0000.00719.98
8.0.290.0000.00717.05
8.0.280.0040.00418.46
8.0.270.0040.00417.20
8.0.260.0030.00316.90
8.0.250.0000.00716.87
8.0.240.0000.00716.93
8.0.230.0030.00316.93
8.0.220.0030.00316.86
8.0.210.0040.00416.99
8.0.200.0000.00616.98
8.0.190.0040.00417.09
8.0.180.0000.00716.88
8.0.170.0040.00416.89
8.0.160.0040.00417.02
8.0.150.0040.00416.86
8.0.140.0000.00716.95
8.0.130.0000.00613.45
8.0.120.0040.00416.81
8.0.110.0000.00717.01
8.0.100.0070.00016.82
8.0.90.0000.00716.90
8.0.80.0060.01316.91
8.0.70.0030.00617.01
8.0.60.0000.00816.96
8.0.50.0000.00716.78
8.0.30.0110.00817.00
8.0.20.0110.00817.40
8.0.10.0040.00417.11
8.0.00.0090.00916.85
7.4.330.0050.00015.00
7.4.320.0000.00716.56
7.4.300.0020.00516.52
7.4.290.0030.00316.54
7.4.280.0050.00216.60
7.4.270.0040.00416.50
7.4.260.0070.00016.40
7.4.250.0000.00716.56
7.4.240.0020.00516.63
7.4.230.0030.00316.58
7.4.220.0070.01116.61
7.4.210.0060.00916.60
7.4.200.0030.00316.69
7.4.190.0030.00316.77
7.4.160.0120.00816.45
7.4.150.0140.00517.40
7.4.140.0110.00717.86
7.4.130.0100.00716.47
7.4.120.0110.00916.60
7.4.110.0060.01216.45
7.4.100.0120.00616.46
7.4.90.0110.00716.49
7.4.80.0130.00319.39
7.4.70.0060.01016.73
7.4.60.0180.00016.41
7.4.50.0000.00816.60
7.4.40.0030.01122.77
7.4.30.0000.01616.48
7.4.00.0040.01014.90
7.3.330.0000.00513.23
7.3.320.0020.00213.25
7.3.310.0030.00316.10
7.3.300.0000.00616.20
7.3.290.0060.00916.35
7.3.280.0090.00816.29
7.3.270.0090.01117.40
7.3.260.0160.00316.60
7.3.250.0100.00716.33
7.3.240.0030.01416.27
7.3.230.0100.00716.39
7.3.210.0080.00816.49
7.3.200.0080.00919.39
7.3.190.0030.01816.28
7.3.180.0080.00816.30
7.3.170.0090.01116.29
7.3.160.0070.01016.20
7.3.120.0090.00914.74
7.3.110.0070.01014.43
7.3.100.0030.01214.71
7.3.90.0070.00714.63
7.3.80.0110.00314.55
7.3.70.0060.00714.69
7.3.60.0070.00914.69
7.3.50.0060.00614.74
7.3.40.0030.00914.54
7.3.30.0110.00514.56
7.3.20.0070.00316.54
7.3.10.0040.01116.72
7.3.00.0050.00716.58
7.2.330.0160.00416.47
7.2.320.0110.00716.68
7.2.310.0130.01016.65
7.2.300.0130.00616.43
7.2.290.0000.01816.57
7.2.250.0140.00314.77
7.2.240.0070.01114.95
7.2.230.0070.00614.93
7.2.220.0030.01115.32
7.2.210.0060.00815.01
7.2.200.0050.00814.92
7.2.190.0070.00715.13
7.2.180.0080.00815.15
7.2.170.0040.01415.00
7.2.160.0070.01115.16
7.2.150.0100.00716.87
7.2.140.0000.01417.06
7.2.130.0030.01416.98
7.2.120.0030.01316.98
7.2.110.0070.00716.73
7.2.100.0100.00716.96
7.2.90.0040.01216.86
7.2.80.0060.00916.98
7.2.70.0030.01017.02
7.2.60.0000.01216.73
7.2.50.0040.01216.92
7.2.40.0070.00416.79
7.2.30.0060.00916.99
7.2.20.0090.00616.83
7.2.10.0090.00316.89
7.2.00.0080.00818.23
7.1.330.0070.00915.88
7.1.320.0090.00515.92
7.1.310.0030.01215.88
7.1.300.0050.00915.85
7.1.290.0030.01015.47
7.1.280.0030.01215.69
7.1.270.0070.00815.70
7.1.260.0060.00615.58
7.1.250.0040.00715.80
7.1.200.0040.01115.80
7.1.100.0060.00918.02
7.1.70.0080.00317.20
7.1.60.0000.01016.97
7.1.50.0170.01434.57
7.1.00.0070.07322.30
7.0.200.0060.00916.74
7.0.140.0000.07721.96
7.0.60.0030.04320.01
7.0.50.0030.08017.91
7.0.40.0100.06320.27
7.0.30.0300.07720.06
7.0.20.0130.04320.24
7.0.10.0030.06320.09
7.0.00.0070.08720.06
5.6.280.0030.07321.14
5.6.210.0130.06320.76
5.6.200.0030.05018.20
5.6.190.0070.08020.64
5.6.180.0430.07320.77
5.6.170.0200.04720.39
5.6.160.0000.08720.47
5.6.150.0070.05718.24
5.6.140.0030.08718.14
5.6.130.0200.06718.14
5.6.120.0070.05720.98
5.6.110.0070.08721.05
5.6.100.0070.05720.99
5.6.90.0000.04321.11
5.6.80.0070.05720.30
5.5.350.0200.04020.33
5.5.340.0100.07717.98
5.5.330.0030.04320.47
5.5.320.0330.06020.27
5.5.310.0500.06320.27
5.5.300.0070.04017.94
5.5.290.0030.06717.93
5.5.280.0070.05020.79
5.5.270.0030.08320.88
5.5.260.0030.05320.77
5.5.250.0000.08720.70
5.5.240.0000.09020.28
5.4.450.4070.03719.45
5.4.440.0030.07719.36
5.4.430.1700.05319.27
5.4.420.3770.06019.25
5.4.410.4000.03719.41
5.4.400.3930.03018.98
5.4.390.3700.03719.14
5.4.380.4430.04318.99
5.4.370.3830.04318.93
5.4.360.3770.04019.21
5.4.350.3630.04319.20
5.4.340.3670.03719.21
5.4.320.0070.03719.15
5.4.310.2530.03718.94
5.4.300.3630.04019.12
5.4.290.3770.02718.95
5.4.280.3770.04019.10
5.4.270.3800.03318.98
5.4.260.3830.02719.14
5.4.250.3600.04019.03
5.4.240.3400.03319.03
5.4.230.3900.03719.11
5.4.220.4130.03319.21
5.4.210.3770.02719.10
5.4.200.4100.03719.23
5.4.190.3570.04018.94
5.4.180.3770.04019.11
5.4.170.4130.03319.13
5.4.160.4600.04019.18
5.4.150.4330.03719.22
5.4.140.4270.04316.49
5.4.130.3900.03316.43
5.4.120.3700.03316.49
5.4.110.4170.03316.47
5.4.100.3900.03716.54
5.4.90.3570.03716.53
5.4.80.3800.03316.57
5.4.70.3470.03016.57
5.4.60.3830.03316.54
5.4.50.3970.03016.53
5.4.40.3900.03316.33
5.4.30.3100.03316.45
5.4.20.3470.03316.45
5.4.10.4130.04016.45
5.4.00.3470.03715.99
5.3.290.0070.04714.60
5.3.280.4000.03014.62
5.3.270.4630.03714.51
5.3.260.4430.04714.77
5.3.250.4630.03714.66
5.3.240.4500.03714.66
5.3.230.3900.04014.67
5.3.220.3870.04014.65
5.3.210.3630.03714.65
5.3.200.4200.03714.74
5.3.190.3230.03014.58
5.3.180.3830.03714.59
5.3.170.3570.03714.54
5.3.160.3830.03714.63
5.3.150.3630.03314.63
5.3.140.3470.04014.63
5.3.130.4200.04714.59
5.3.120.4430.03314.56
5.3.110.3800.04014.45
5.3.100.3730.04014.06
5.3.90.3600.04014.18
5.3.80.3630.03714.11
5.3.70.3600.04014.05
5.3.60.3670.04014.02
5.3.50.3630.03014.00
5.3.40.4370.03313.97
5.3.30.4000.03713.98
5.3.20.3870.04013.87
5.3.10.4200.03313.70
5.3.00.3630.03013.65
5.2.170.3270.02711.14
5.2.160.3530.02711.04
5.2.150.3630.02711.16
5.2.140.3600.02711.15
5.2.130.3930.03011.03
5.2.120.3070.03011.04
5.2.110.3300.03011.06
5.2.100.3200.02711.18
5.2.90.3370.02011.11
5.2.80.3070.03011.18
5.2.70.3000.03011.08
5.2.60.3130.02710.93
5.2.50.3370.02710.91
5.2.40.2530.03010.96
5.2.30.2870.03010.98
5.2.20.2700.03310.85
5.2.10.2870.04010.86
5.2.00.2670.03010.72
5.1.60.2600.0179.98
5.1.50.2570.01710.07
5.1.40.2770.02010.04
5.1.30.2830.03010.38
5.1.20.2670.02710.37
5.1.10.2570.02310.13
5.1.00.3270.03010.04
5.0.50.1500.0238.45
5.0.40.1500.0208.39
5.0.30.2500.0308.13
5.0.20.1530.0178.15
5.0.10.1500.0178.25
5.0.00.1730.0338.18
4.4.90.1400.0176.35
4.4.80.1400.0176.35
4.4.70.1430.0136.35
4.4.60.1230.0136.35
4.4.50.1230.0136.35
4.4.40.1470.0306.35
4.4.30.1470.0176.35
4.4.20.1200.0136.35
4.4.10.1530.0206.35
4.4.00.1300.0236.35
4.3.110.1530.0276.35
4.3.100.1670.0176.35
4.3.90.1400.0176.35
4.3.80.1600.0236.35
4.3.70.1830.0176.35
4.3.60.1430.0176.35
4.3.50.1470.0136.35
4.3.40.1670.0276.35
4.3.30.0830.0236.35
4.3.20.0770.0176.35
4.3.10.0830.0276.35
4.3.00.0900.0236.35

preferences:
71.29 ms | 401 KiB | 5 Q