3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass { protected $arr; public function __construct() { $this->arr = array(); } public function getArr() { return $this->arr; } public function append($arr) { $this->$arr[] = $arr; } public function merge($arr) { $this->$arr = array_merge($this->arr, $arr); } } $arr = array('a','b'); $obj = new MyClass(); $obj->append($arr);//使用append无法修改类属性 var_dump($obj->getArr()); //output : //array(0){} $obj->merge($arr);//使用merge可以 var_dump($obj->getArr()); //output: //array(2){'a','b'}

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.00318.56
8.3.50.0120.01022.07
8.3.40.0070.00718.76
8.3.30.0080.00619.06
8.3.20.0030.00520.34
8.3.10.0060.00320.48
8.3.00.0030.00619.38
8.2.180.0150.00618.29
8.2.170.0140.00722.96
8.2.160.0100.00320.36
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0000.00726.16
8.2.120.0030.00522.11
8.2.110.0100.00020.25
8.2.100.0030.00718.09
8.2.90.0040.00419.18
8.2.80.0000.00917.97
8.2.70.0050.00317.63
8.2.60.0040.00418.04
8.2.50.0090.00018.07
8.2.40.0000.00718.22
8.2.30.0040.00419.26
8.2.20.0050.00317.69
8.2.10.0040.00418.19
8.2.00.0040.00417.65
8.1.280.0140.00025.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.95
8.1.230.0080.00419.04
8.1.220.0080.00017.78
8.1.210.0040.00418.77
8.1.200.0030.00617.38
8.1.190.0040.00417.25
8.1.180.0040.00418.10
8.1.170.0030.00918.58
8.1.160.0060.00321.99
8.1.150.0030.00518.90
8.1.140.0040.00417.43
8.1.130.0030.00317.76
8.1.120.0000.00717.37
8.1.110.0040.00417.46
8.1.100.0000.00717.47
8.1.90.0030.00317.38
8.1.80.0000.00717.42
8.1.70.0070.00017.36
8.1.60.0050.00317.55
8.1.50.0070.00317.55
8.1.40.0040.00417.44
8.1.30.0040.00417.54
8.1.20.0050.00317.66
8.1.10.0000.00817.48
8.1.00.0090.00317.52
8.0.300.0040.00418.77
8.0.290.0080.00016.63
8.0.280.0070.00018.46
8.0.270.0070.00017.23
8.0.260.0070.00018.51
8.0.250.0000.00716.92
8.0.240.0030.00517.01
8.0.230.0000.00717.09
8.0.220.0000.00816.97
8.0.210.0000.00716.86
8.0.200.0000.00717.07
8.0.190.0030.00616.92
8.0.180.0040.00416.97
8.0.170.0030.00517.05
8.0.160.0070.00017.02
8.0.150.0030.00316.75
8.0.140.0040.00416.89
8.0.130.0060.00013.33
8.0.120.0030.00516.89
8.0.110.0040.00416.92
8.0.100.0000.00816.85
8.0.90.0000.00816.87
8.0.80.0080.00816.95
8.0.70.0050.00317.00
8.0.60.0000.00816.96
8.0.50.0050.00216.95
8.0.30.0170.00317.06
8.0.20.0120.00617.40
8.0.10.0000.00717.08
8.0.00.0060.01116.78
7.4.330.0000.00515.00
7.4.320.0030.00316.57
7.4.300.0030.00316.62
7.4.290.0000.00616.68
7.4.280.0000.00716.51
7.4.270.0050.00216.47
7.4.260.0020.00516.53
7.4.250.0040.00316.53
7.4.240.0000.00816.50
7.4.230.0050.00316.60
7.4.220.0130.01316.43
7.4.210.0000.01416.55
7.4.200.0030.00316.68
7.4.160.0050.01116.44
7.4.150.0150.00917.40
7.4.140.0130.00417.86
7.4.130.0050.01116.54
7.4.120.0090.00916.59
7.4.110.0000.01716.52
7.4.100.0120.00616.65
7.4.90.0150.00316.55
7.4.80.0070.01119.37
7.4.70.0120.00616.51
7.4.60.0000.01616.36
7.4.50.0030.00516.55
7.4.40.0120.00616.63
7.4.30.0080.00816.61
7.4.00.0090.00614.94
7.3.330.0030.00313.46
7.3.320.0000.00613.37
7.3.310.0000.00716.40
7.3.300.0030.00316.48
7.3.290.0130.00316.40
7.3.280.0070.00816.43
7.3.270.0040.01517.40
7.3.260.0140.00316.43
7.3.250.0110.00916.51
7.3.240.0140.00416.37
7.3.230.0060.01216.70
7.3.210.0090.00616.64
7.3.200.0170.00619.39
7.3.190.0030.01916.44
7.3.180.0140.00316.31
7.3.170.0150.00416.31
7.3.160.0070.01016.46
7.3.10.0040.01116.66
7.3.00.0030.00616.59
7.2.330.0080.00816.61
7.2.320.0060.01116.75
7.2.310.0090.00916.52
7.2.300.0070.01416.81
7.2.290.0100.00616.86
7.2.130.0060.00916.96
7.2.120.0000.01216.73
7.2.110.0040.00716.87
7.2.100.0090.00616.99
7.2.90.0000.01416.98
7.2.80.0060.00916.96
7.2.70.0130.00316.94
7.2.60.0090.00316.83
7.2.50.0090.00216.79
7.2.40.0030.01016.79
7.2.30.0100.00617.03
7.2.20.0000.01316.75
7.2.10.0100.00716.76
7.2.00.0070.00718.01
7.1.250.0080.00415.79
7.1.200.0060.00615.88
7.1.100.0030.01018.04
7.1.70.0000.00817.18
7.1.60.0100.01419.32
7.1.50.0070.01716.63
7.1.00.0030.07722.31
7.0.200.0040.00416.74
7.0.140.0000.07321.98
7.0.60.0200.06719.87
7.0.50.0100.06317.73
7.0.40.0070.09020.14
7.0.30.0170.04320.23
7.0.20.0370.05020.23
7.0.10.0100.05020.23
7.0.00.0100.08020.23
5.6.280.0030.07320.93
5.6.210.0030.04020.77
5.6.200.0030.04718.29
5.6.190.0000.04320.61
5.6.180.0300.08020.77
5.6.170.0300.07320.51
5.6.160.0130.07320.44
5.6.150.0100.08318.18
5.6.140.0100.08318.28
5.6.130.0030.08718.23
5.6.120.0000.04721.02
5.6.110.0070.08321.14
5.6.100.0030.08321.00
5.6.90.0170.06721.11
5.6.80.0030.07720.54
5.5.350.0000.08720.31
5.5.340.0130.07317.95
5.5.330.0030.06320.31
5.5.320.0070.04320.30
5.5.310.0330.06720.36
5.5.300.0130.06017.95
5.5.290.0030.08717.96
5.5.280.0100.06020.91
5.5.270.0030.05020.76
5.5.260.0100.08320.84
5.5.250.0130.07020.59
5.5.240.0100.07720.25
5.4.450.0870.04319.55
5.4.440.0730.06319.63
5.4.430.0900.06019.30
5.4.420.0670.00019.67
5.4.410.0670.00019.42
5.4.400.0730.00019.23
5.4.390.0670.00019.12
5.4.380.0200.06018.76
5.4.370.0400.05718.79
5.4.360.0300.05318.62
5.4.350.0270.06718.57
5.4.340.0330.05318.64
5.4.320.0070.03512.52
5.4.310.0030.04012.51
5.4.300.0040.03812.52
5.4.290.0060.03812.51
5.4.280.0040.03712.41
5.4.270.0070.03412.41
5.4.260.0050.03812.41
5.4.250.0030.03912.41
5.4.240.0070.03412.41
5.4.230.0060.04112.40
5.4.220.0050.03512.40
5.4.210.0070.03812.40
5.4.200.0080.03812.40
5.4.190.0060.03712.39
5.4.180.0030.04012.40
5.4.170.0070.03512.41
5.4.160.0080.03512.40
5.4.150.0060.03612.40
5.4.140.0070.03512.09
5.4.130.0070.03412.07
5.4.120.0040.04412.03
5.4.110.0030.03712.03
5.4.100.0050.03512.03
5.4.90.0010.04112.02
5.4.80.0080.03812.02
5.4.70.0040.03612.03
5.4.60.0060.03512.02
5.4.50.0100.03012.02
5.4.40.0050.03712.01
5.4.30.0110.03012.01
5.4.20.0070.03412.00
5.4.10.0020.03812.00
5.4.00.0050.03611.50
5.3.290.0090.03612.80
5.3.280.0070.03712.70
5.3.270.0050.04012.73
5.3.260.0060.03812.72
5.3.250.0090.03412.72
5.3.240.0100.03512.72
5.3.230.0080.03812.71
5.3.220.0060.03712.68
5.3.210.0060.05312.68
5.3.200.0040.03812.68
5.3.190.0040.04712.68
5.3.180.0060.03612.67
5.3.170.0040.04712.67
5.3.160.0060.03712.68
5.3.150.0080.03612.67
5.3.140.0070.03812.66
5.3.130.0040.04012.66
5.3.120.0050.03912.66
5.3.110.0050.04212.65
5.3.100.0070.03512.13
5.3.90.0070.03512.11
5.3.80.0070.04012.09
5.3.70.0060.03612.09
5.3.60.0050.03712.08
5.3.50.0040.03912.03
5.3.40.0050.04112.04
5.3.30.0060.03711.98
5.3.20.0070.03611.77
5.3.10.0070.03411.73
5.3.00.0060.03811.72
5.2.170.0070.0289.23
5.2.160.0060.0279.22
5.2.150.0040.0319.23
5.2.140.0080.0319.23
5.2.130.0060.0299.18
5.2.120.0040.0289.18
5.2.110.0060.0289.19
5.2.100.0050.0299.18
5.2.90.0050.0289.19
5.2.80.0040.0309.18
5.2.70.0080.0289.18
5.2.60.0030.0339.13
5.2.50.0020.0329.09
5.2.40.0020.0309.07
5.2.30.0030.0319.05
5.2.20.0060.0279.05
5.2.10.0030.0308.95
5.2.00.0090.0248.81
5.1.60.0020.0268.09
5.1.50.0050.0248.09
5.1.40.0020.0278.07
5.1.30.0060.0248.42
5.1.20.0050.0258.45
5.1.10.0050.0268.17
5.1.00.0050.0258.16
5.0.50.0060.0186.65
5.0.40.0030.0206.50
5.0.30.0030.0316.32
5.0.20.0040.0186.29
5.0.10.0030.0216.26
5.0.00.0030.0316.25
4.4.90.0020.0164.78
4.4.80.0040.0144.75
4.4.70.0030.0154.75
4.4.60.0030.0174.76
4.4.50.0040.0174.77
4.4.40.0030.0254.71
4.4.30.0040.0144.76
4.4.20.0040.0144.85
4.4.10.0010.0174.85
4.4.00.0030.0254.76
4.3.110.0030.0184.67
4.3.100.0040.0204.66
4.3.90.0050.0194.63
4.3.80.0030.0324.58
4.3.70.0020.0224.63
4.3.60.0020.0204.63
4.3.50.0040.0154.63
4.3.40.0060.0254.54
4.3.30.0030.0163.30
4.3.20.0020.0153.28
4.3.10.0040.0133.24
4.3.00.0100.01314.30

preferences:
38.35 ms | 401 KiB | 5 Q