3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $id; } class Foo2 { public $id; public function __construct($id) { $this->id = $id; } } class Foo3 { protected $id; public function __construct($id) { $this->id = $id; } public function getId() { return $this->id; } } class Foo4 { private $id; public function __construct($id) { $this->id = $id; } public function __get($key) { echo $key; return $this->id; } } $data = new Foo; $data->id = 10; echo $data->id; $data2 = new Foo2(10); echo $data2->id; $data3 = new Foo3(10); echo $data3->getId(); $data4 = new Foo4(10); echo $data4->id;

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.0140.00718.68
8.3.50.0140.00722.11
8.3.40.0090.00618.84
8.3.30.0100.00320.34
8.3.20.0050.00220.35
8.3.10.0040.00421.93
8.3.00.0040.00422.37
8.2.180.0110.01116.63
8.2.170.0140.00322.96
8.2.160.0100.00322.25
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0140.00326.16
8.2.120.0000.00819.62
8.2.110.0060.00322.16
8.2.100.0080.00419.27
8.2.90.0000.00819.19
8.2.80.0050.00319.39
8.2.70.0080.00017.38
8.2.60.0000.00818.03
8.2.50.0000.00818.07
8.2.40.0030.00518.28
8.2.30.0080.00018.06
8.2.20.0040.00417.70
8.2.10.0000.00817.61
8.2.00.0030.00717.73
8.1.280.0140.00425.92
8.1.270.0090.00024.66
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0090.00023.85
8.1.230.0040.00719.00
8.1.220.0000.00717.79
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0040.00417.27
8.1.180.0040.00419.01
8.1.170.0040.00418.64
8.1.160.0000.00722.13
8.1.150.0040.00718.58
8.1.140.0030.00717.31
8.1.130.0030.00317.77
8.1.120.0050.00217.29
8.1.110.0000.00717.43
8.1.100.0040.00417.34
8.1.90.0040.00417.41
8.1.80.0020.00517.28
8.1.70.0030.00317.34
8.1.60.0000.00817.57
8.1.50.0000.00817.41
8.1.40.0050.00317.54
8.1.30.0080.00017.63
8.1.20.0060.00317.61
8.1.10.0000.00917.61
8.1.00.0040.00417.46
8.0.300.0000.00718.77
8.0.290.0000.00717.16
8.0.280.0030.00518.35
8.0.270.0000.00817.25
8.0.260.0060.00016.81
8.0.250.0000.00716.92
8.0.240.0030.00616.91
8.0.230.0030.00316.87
8.0.220.0060.00016.77
8.0.210.0030.00316.82
8.0.200.0030.00316.93
8.0.190.0060.00316.90
8.0.180.0030.00316.91
8.0.170.0040.00416.80
8.0.160.0030.00316.82
8.0.150.0040.00416.77
8.0.140.0000.00716.75
8.0.130.0050.00013.26
8.0.120.0000.00716.81
8.0.110.0070.00016.81
8.0.100.0040.00416.70
8.0.90.0050.00216.69
8.0.80.0120.00316.79
8.0.70.0000.00816.77
8.0.60.0000.00716.73
8.0.50.0070.00016.77
8.0.30.0120.00817.15
8.0.20.0090.00817.40
8.0.10.0040.00416.84
8.0.00.0080.01116.55
7.4.330.0020.00215.00
7.4.320.0050.00216.58
7.4.300.0040.00416.52
7.4.290.0040.00416.47
7.4.280.0020.00516.64
7.4.270.0060.00016.55
7.4.260.0030.00616.36
7.4.250.0040.00416.53
7.4.240.0020.00616.55
7.4.230.0030.00316.58
7.4.220.0030.02116.45
7.4.210.0050.01216.60
7.4.200.0030.00316.68
7.4.190.0080.00016.45
7.4.160.0160.00016.66
7.4.150.0030.01417.40
7.4.140.0090.01217.86
7.4.130.0100.00716.44
7.4.120.0120.00916.59
7.4.110.0100.00716.47
7.4.100.0030.01516.49
7.4.90.0090.00916.39
7.4.80.0130.00919.39
7.4.70.0060.01016.50
7.4.60.0070.01016.34
7.4.50.0000.00816.38
7.4.40.0090.00322.77
7.4.30.0060.01316.34
7.4.00.0050.00814.92
7.3.330.0020.00313.24
7.3.320.0030.00313.26
7.3.310.0030.00316.30
7.3.300.0030.00616.29
7.3.290.0070.00716.35
7.3.280.0080.00716.29
7.3.270.0070.01017.40
7.3.260.0070.01016.66
7.3.250.0090.01116.61
7.3.240.0130.01016.30
7.3.230.0110.00716.41
7.3.210.0110.00616.32
7.3.200.0080.00819.39
7.3.190.0120.00916.45
7.3.180.0210.00316.63
7.3.170.0040.01116.56
7.3.160.0100.00716.35
7.3.120.0040.00415.09
7.2.330.0150.00416.80
7.2.320.0080.01016.60
7.2.310.0090.01016.78
7.2.300.0000.02016.80
7.2.290.0100.01316.74
7.2.00.0000.01019.50
7.1.100.0150.00418.04
7.1.70.0030.00617.19
7.1.60.0140.01019.43
7.1.50.0000.01117.05
7.1.00.0000.04722.33
7.0.200.0390.01216.48
7.0.140.0000.07722.10
7.0.60.0030.07719.96
7.0.50.0100.08017.98
7.0.40.0130.08320.07
7.0.30.0130.04720.09
7.0.20.0330.08020.24
7.0.10.0270.07720.12
7.0.00.0070.09320.29
5.6.280.0100.06720.91
5.6.210.0130.08020.70
5.6.200.0030.05018.29
5.6.190.0000.04720.38
5.6.180.0100.04720.62
5.6.170.0500.07320.45
5.6.160.0130.04320.44
5.6.150.0070.08018.29
5.6.140.0030.08718.26
5.6.130.0030.06018.15
5.6.120.0130.07721.00
5.6.110.0070.08320.98
5.6.100.0130.07721.04
5.6.90.0030.09021.02
5.6.80.0130.07320.41
5.6.70.0300.03720.38
5.5.350.0000.08720.33
5.5.340.0100.07018.04
5.5.330.0070.07020.41
5.5.320.0300.07320.20
5.5.310.0330.06320.42
5.5.300.0030.04718.04
5.5.290.0070.04717.95
5.5.280.0030.04020.91
5.5.270.0030.05720.89
5.5.260.0070.05720.89
5.5.250.0000.08020.60
5.5.240.0070.07320.30
5.4.450.0800.05019.55
5.4.440.0800.06319.35
5.4.430.1030.05319.57
5.4.420.0730.05719.47
5.4.410.0970.05019.30
5.4.400.1230.05318.79
5.4.390.1270.05018.74
5.4.380.0230.04718.61
5.4.370.0130.05318.51
5.4.360.0100.05718.60
5.4.350.0080.05212.03
5.4.340.0080.03912.02
5.4.320.0050.03612.52
5.4.310.0080.03512.51
5.4.300.0060.03512.52
5.4.290.0050.04112.50
5.4.280.0080.03912.40
5.4.270.0060.03712.40
5.4.260.0050.03712.40
5.4.250.0060.03712.40
5.3.290.0090.04512.80
4.3.00.0130.0206.84

preferences:
40.53 ms | 401 KiB | 5 Q