3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait one { public function setOne($data) { $this->{__TRAIT__ . '\data'} = $data; } public function getOne() { return $this->{__TRAIT__ . '\data'}; } } trait two { public function setTwo($data) { $this->{__TRAIT__ . '\data'} = $data; } public function getTwo() { return $this->{__TRAIT__ . '\data'}; } } class Bar { use one; use two; } $bar = new Bar; $bar->setOne(1); $bar->setTwo(2); print_r($bar); echo "Bar getOne: " . $bar->getOne() . '<br>' . PHP_EOL; // echoes 2 instead of wanted 1 echo "Bar getTwo: " . $bar->getTwo() . '<br>' . PHP_EOL; // overwrites $this->data = 1 with 2

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.00818.91
8.5.00.0140.00920.02
8.4.150.0010.00114.05
8.4.140.0100.01317.41
8.4.130.0070.00218.58
8.4.120.0100.00924.34
8.4.110.0080.01022.54
8.4.100.0120.00817.72
8.4.90.0120.01118.66
8.4.80.0120.00720.80
8.4.70.0120.00818.09
8.4.60.0130.00718.83
8.4.50.0080.01120.41
8.4.40.0080.01219.47
8.4.30.0030.00620.38
8.4.20.0000.00817.86
8.4.10.0030.00617.78
8.3.280.0120.00818.31
8.3.270.0130.00616.69
8.3.260.0080.01116.73
8.3.250.0110.00718.98
8.3.240.0110.00717.23
8.3.230.0070.00416.89
8.3.220.0050.00217.42
8.3.210.0100.01016.88
8.3.200.0020.00716.89
8.3.190.0130.00817.22
8.3.180.0140.00616.86
8.3.170.0110.00818.79
8.3.160.0140.00417.14
8.3.150.0120.00618.82
8.3.140.0060.00916.62
8.3.130.0120.00316.68
8.3.120.0070.01020.59
8.3.110.0000.00920.94
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0100.00019.36
8.3.70.0080.00816.63
8.3.60.0140.00018.80
8.3.50.0080.00923.59
8.3.40.0120.00618.93
8.3.30.0120.00318.63
8.3.20.0000.00721.86
8.3.10.0040.00422.13
8.3.00.0090.00023.53
8.2.290.0080.00320.51
8.2.280.0130.00718.61
8.2.270.0070.01317.23
8.2.260.0100.00718.63
8.2.250.0080.01118.43
8.2.240.0090.00018.79
8.2.230.0080.00022.58
8.2.220.0080.00037.54
8.2.210.0000.00726.77
8.2.200.0000.00818.88
8.2.190.0070.00716.63
8.2.180.0150.00016.73
8.2.170.0160.00622.96
8.2.160.0070.00720.39
8.2.150.0090.00024.18
8.2.140.0030.00524.66
8.2.130.0070.00026.16
8.2.120.0070.00026.16
8.2.110.0090.00022.11
8.2.100.0110.00019.70
8.2.90.0050.00317.63
8.2.80.0060.00318.78
8.2.70.0070.00317.63
8.2.60.0000.00818.04
8.2.50.0040.00418.05
8.2.40.0080.00018.22
8.2.30.0080.00019.32
8.2.20.0070.00017.99
8.2.10.0040.00419.25
8.2.00.0000.00719.14
8.1.330.0100.00921.72
8.1.320.0100.01016.36
8.1.310.0070.00718.64
8.1.300.0090.00916.09
8.1.290.0060.00330.84
8.1.280.0110.00425.92
8.1.270.0080.00021.78
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0050.00520.72
8.1.230.0040.00817.64
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.36
8.1.180.0000.00818.10
8.1.170.0030.00617.62
8.1.160.0050.00218.90
8.1.150.0000.00818.90
8.1.140.0000.00720.68
8.1.130.0030.00320.17
8.1.120.0000.00717.41
8.1.110.0050.00217.43
8.1.100.0000.00817.43
8.1.90.0090.00017.47
8.1.80.0000.00817.43
8.1.70.0070.00017.34
8.1.60.0060.00317.57
8.1.50.0040.00417.36
8.1.40.0040.00417.41
8.1.30.0000.00817.67
8.1.20.0060.00317.62
8.1.10.0030.00617.63
8.1.00.0030.00917.48
8.0.300.0070.00018.90
8.0.290.0040.00416.63
8.0.280.0000.00718.46
8.0.270.0030.00518.01
8.0.260.0040.00420.08
8.0.250.0030.00316.80
8.0.240.0030.00616.95
8.0.230.0050.00216.96
8.0.220.0030.00316.89
8.0.210.0070.00016.89
8.0.200.0000.00716.97
8.0.190.0040.00416.90
8.0.180.0000.00816.91
8.0.170.0060.00316.90
8.0.160.0030.00616.91
8.0.150.0040.00416.93
8.0.140.0070.00016.79
8.0.130.0000.00613.32
8.0.120.0000.00816.92
8.0.110.0040.00416.96
8.0.100.0040.00416.92
8.0.90.0040.00416.72
8.0.80.0070.01416.86
8.0.70.0080.00016.77
8.0.60.0060.00316.89
8.0.50.0040.00416.84
8.0.30.0070.01516.97
8.0.20.0240.00317.10
8.0.10.0000.00716.87
8.0.00.0140.00316.98
7.4.330.0050.00016.76
7.4.320.0060.00016.61
7.4.300.0000.00716.57
7.4.290.0000.00716.42
7.4.280.0000.00816.49
7.4.270.0030.00316.41
7.4.260.0030.00313.29
7.4.250.0000.00716.46
7.4.240.0040.00416.52
7.4.230.0030.00316.48
7.4.220.0040.00416.45
7.4.210.0110.00416.52
7.4.200.0050.00316.65
7.4.130.0090.00916.59
7.4.120.0100.01316.57
7.4.110.0110.00816.59
7.4.100.0060.01216.53
7.4.90.0080.01216.46
7.4.80.0040.01319.39
7.4.70.0030.01316.56
7.4.60.0090.00916.41
7.4.50.0090.00616.26
7.4.40.0120.00616.42
7.4.20.0160.00516.17
7.4.10.0110.01116.05
7.4.00.0090.01216.48
7.3.330.0000.00716.40
7.3.320.0000.00613.30
7.3.310.0070.00016.25
7.3.300.0030.00316.22
7.3.290.0040.01016.30
7.3.260.0120.00616.65
7.3.240.0100.00716.29
7.3.230.0100.01016.37
7.3.210.0100.00716.34
7.3.200.0030.01416.42
7.3.190.0080.00916.61
7.3.180.0090.00616.49
7.3.170.0030.01516.34
7.3.160.0120.01216.59
7.3.130.0080.01216.05
7.3.120.0150.00716.38
7.3.110.0150.00316.57
7.3.100.0110.00516.12
7.3.90.0080.01116.35
7.3.80.0030.01516.00
7.3.70.0090.00916.29
7.3.60.0110.01016.16
7.3.50.0000.01816.22
7.3.40.0060.01016.16
7.3.30.0080.00816.09
7.3.20.0100.00716.31
7.3.10.0130.00316.29
7.3.00.0110.00716.19
7.2.330.0060.01416.79
7.2.320.0150.00316.53
7.2.310.0060.01216.54
7.2.300.0090.01216.46
7.2.290.0090.00916.82
7.2.260.0040.01916.56
7.2.250.0050.01416.48
7.2.240.0130.00716.07
7.2.230.0030.01516.57
7.2.220.0070.01016.47
7.2.210.0060.01016.23
7.2.200.0140.00416.25
7.2.190.0120.00616.40
7.2.180.0070.01016.50
7.2.170.0100.00616.57
7.2.160.0070.01016.50
7.2.150.0090.00616.79
7.2.140.0130.00316.66
7.2.130.0130.00316.25
7.2.120.0080.00816.40
7.2.110.0080.01516.28
7.2.100.0060.01216.50
7.2.90.0140.00316.22
7.2.80.0140.01016.24
7.2.70.0120.00616.61
7.2.60.0130.01016.36
7.2.50.0070.01616.57
7.2.40.0160.00016.63
7.2.30.0100.01016.73
7.2.20.0000.01916.59
7.2.10.0060.01016.51
7.2.00.0120.01216.34

preferences:
173.71 ms | 403 KiB | 5 Q