3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Countable { public $prop1; private $propa=2; protected $propx=3; public $prop4 = array(1,2,3,4); public function Greet() { return 'hello world'; } public function getCount() { $res = (array) $this; return count($res); } public function count() { echo 'Trying to get the count ...'; return $this->getCount(); } } // per manual: ArrayObject constructed from array means all properties are public. $t = new Test; echo $t->Greet(),"\n"; echo count( (array) $t),"\n"; echo $t->getCount(),"\n"; echo count($t),"\n"; var_dump( get_object_vars($t) ); $a = (array) $t; echo count($ao = new ArrayObject($a)),"\n"; echo $ao->count(); echo is_countable($ao);

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.0120.00316.75
8.3.50.0130.00722.18
8.3.40.0110.00418.59
8.3.30.0080.01319.13
8.3.20.0000.00820.34
8.3.10.0030.00523.65
8.3.00.0030.00717.48
8.2.180.0110.00718.54
8.2.170.0120.00622.96
8.2.160.0070.00720.39
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00422.25
8.2.110.0080.00022.02
8.2.100.0030.00917.91
8.2.90.0080.00019.23
8.2.80.0000.00817.97
8.2.70.0000.01317.50
8.2.60.0050.00317.80
8.2.50.0060.00318.07
8.2.40.0040.00418.28
8.2.30.0020.00518.21
8.2.20.0050.00217.79
8.2.10.0070.00017.99
8.2.00.0070.00417.59
8.1.280.0160.00325.92
8.1.270.0090.00323.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00423.84
8.1.230.0030.00719.10
8.1.220.0050.00317.74
8.1.210.0060.00618.77
8.1.200.0090.00017.35
8.1.190.0000.00817.43
8.1.180.0030.00618.10
8.1.170.0060.00618.75
8.1.160.0000.00722.05
8.1.150.0050.00218.67
8.1.140.0040.00417.48
8.1.130.0030.00317.83
8.1.120.0000.00717.39
8.1.110.0040.00417.50
8.1.100.0080.00017.38
8.1.90.0040.00417.46
8.1.80.0020.00517.49
8.1.70.0040.00417.43
8.1.60.0070.00317.63
8.1.50.0050.00317.38
8.1.40.0030.00517.54
8.1.30.0040.00417.68
8.1.20.0000.00817.78
8.1.10.0020.00517.54
8.1.00.0040.00417.51
8.0.300.0050.00219.27
8.0.290.0000.01017.18
8.0.280.0030.00318.47
8.0.270.0070.00017.29
8.0.260.0030.00317.29
8.0.250.0000.00716.90
8.0.240.0060.00616.94
8.0.230.0000.00716.86
8.0.220.0070.00016.98
8.0.210.0080.00016.80
8.0.200.0030.00716.88
8.0.190.0070.00016.99
8.0.180.0040.00416.91
8.0.170.0000.00916.94
8.0.160.0000.00716.89
8.0.150.0000.00816.79
8.0.140.0040.00416.88
8.0.130.0050.00313.39
8.0.120.0080.00016.86
8.0.110.0040.00416.91
8.0.100.0070.00016.93
8.0.90.0040.00416.82
8.0.80.0090.01216.88
8.0.70.0040.00416.79
8.0.60.0000.00816.80
8.0.50.0080.00016.87
8.0.30.0110.00817.19
8.0.20.0140.01017.40
8.0.10.0000.00816.98
8.0.00.0120.00916.70
7.4.330.0060.00015.00
7.4.320.0030.00316.59
7.4.300.0060.00016.59
7.4.290.0040.00416.68
7.4.280.0040.00416.43
7.4.270.0070.00016.64
7.4.260.0030.00316.59
7.4.250.0040.00416.58
7.4.240.0030.00316.55
7.4.230.0000.00716.45
7.4.220.0030.01316.65
7.4.210.0120.00716.60
7.4.200.0000.00716.48
7.4.190.0030.00616.67
7.4.160.0030.01316.63
7.4.150.0070.01017.40
7.4.140.0090.01017.86
7.4.130.0100.00716.50
7.4.120.0050.01516.47
7.4.110.0110.00716.75
7.4.100.0130.00716.54
7.4.90.0100.00716.48
7.4.80.0140.02119.39
7.4.70.0120.00916.57
7.4.60.0060.01016.49
7.4.50.0050.00316.68
7.4.40.0120.00222.77
7.4.30.0130.00316.58
7.4.00.0000.01514.83
7.3.330.0050.00013.29
7.3.320.0020.00213.35
7.3.310.0030.00316.14
7.3.300.0030.00316.35
7.3.290.0110.00816.30
7.3.280.0130.00516.32
7.3.270.0100.00717.40
7.3.260.0030.01816.38
7.3.250.0160.00516.50
7.3.240.0120.01216.47
7.3.230.0060.01016.56
7.3.210.0110.00816.59
7.3.200.0110.00719.39
7.3.190.0120.00916.53
7.3.180.0050.01116.18
7.3.170.0110.00416.63
7.3.160.0100.00716.69
7.3.120.0030.01214.62
7.2.330.0140.00616.66
7.2.320.0120.00816.75
7.2.310.0070.01316.52
7.2.300.0080.00816.82
7.2.290.0000.01616.48
7.2.60.0050.00816.96
7.2.00.0070.00719.49
7.1.200.0000.00715.96
7.1.100.0080.00318.07
7.1.70.0000.00716.89
7.1.60.0130.01019.33
7.1.50.0090.01516.80
7.1.00.0000.07722.33
7.0.200.0280.00314.80
7.0.140.0000.07322.12
7.0.60.0070.08019.81
7.0.50.0130.04317.90
7.0.40.0030.09020.23
7.0.30.0430.08020.21
7.0.20.0230.08720.17
7.0.10.0030.06020.22
7.0.00.0100.04720.05
5.6.280.0030.07021.08
5.6.210.0100.08320.77
5.6.200.0070.07718.23
5.6.190.0000.05020.51
5.6.180.0200.03720.77
5.6.170.0270.07720.50
5.6.160.0030.04720.44
5.6.150.0030.04718.14
5.6.140.0100.07718.18
5.6.130.0070.09318.19
5.6.120.0030.04020.97
5.6.110.0030.07320.97
5.6.100.0130.06021.09
5.6.90.0070.08721.07
5.6.80.0070.08020.36
5.6.70.4030.04320.53
5.5.350.0170.07720.31
5.5.340.0030.07317.99
5.5.330.0100.05720.29
5.5.320.0100.08320.36
5.5.310.0230.05720.51
5.5.300.0070.08017.93
5.5.290.0130.06017.93
5.5.280.0070.07020.99
5.5.270.0100.08020.89
5.5.260.0000.07020.80
5.5.250.0130.07320.47
5.5.240.0230.06020.24
5.4.450.0130.08019.62
5.4.440.0100.06319.30
5.4.430.0230.05019.61
5.4.420.0130.06019.63
5.4.410.0230.05019.48
5.4.400.0370.03319.07
5.4.390.0300.05018.87
5.4.380.0330.05718.76
5.4.370.0270.06318.80
5.4.360.0200.05318.48
5.4.350.0200.05718.63
5.4.340.0300.05018.75
5.4.320.0080.03612.51
5.4.310.0060.03712.50
5.4.300.0080.03412.51
5.4.290.0070.03612.50
5.4.280.0080.04012.37
5.4.270.0100.04212.37
5.4.260.0060.04212.37
5.4.250.0080.04312.37
5.4.240.0070.04712.38
5.4.230.0090.03712.36
5.4.220.0100.03512.36
5.4.210.0090.03612.36
5.4.200.0070.04012.36
5.4.190.0070.03812.36
5.4.180.0130.03412.36
5.4.170.0090.03812.37
5.4.160.0080.04712.37
5.4.150.0120.05212.36
5.4.140.0140.03312.05
5.4.130.0090.04712.04
5.4.120.0070.04211.99
5.4.110.0100.03811.99
5.4.100.0160.04411.99
5.4.90.0100.05711.99
5.4.80.0090.04911.99
5.4.70.0090.05111.98
5.4.60.0160.04711.99
5.4.50.0070.05311.99
5.4.40.0140.05511.97
5.4.30.0080.04611.97
5.4.20.0090.05011.97
5.4.10.0090.05111.97
5.4.00.0150.04411.46
5.3.290.0060.04312.80
5.3.280.0110.04612.71
5.3.270.0110.05812.73
5.3.260.0150.06412.72
5.3.250.0100.07112.72
5.3.240.0150.06312.72
5.3.230.0160.08612.71
5.3.220.0110.05312.68
5.3.210.0220.07612.68
5.3.200.0080.05812.68
5.3.190.0170.08312.68
5.3.180.0080.05212.68
5.3.170.0140.05312.67
5.3.160.0150.04712.68
5.3.150.0130.05412.67
5.3.140.0060.05812.66
5.3.130.0100.06812.66
5.3.120.0100.06112.66
5.3.110.0170.05812.66
5.3.100.0060.05512.12
5.3.90.0120.05612.09
5.3.80.0110.05612.07
5.3.70.0170.05012.07
5.3.60.0040.06312.06
5.3.50.0160.05312.00
5.3.40.0150.04112.00
5.3.30.0130.06911.97
5.3.20.0130.07011.74
5.3.10.0100.04911.71
5.3.00.0080.05211.70
5.2.170.0110.0439.20
5.2.160.0090.0479.20
5.2.150.0070.0489.20
5.2.140.0070.0469.19
5.2.130.0130.0729.15
5.2.120.0090.0299.16
5.2.110.0070.0319.16
5.2.100.0090.0289.16
5.2.90.0040.0339.16
5.2.80.0090.0429.16
5.2.70.0070.0459.16
5.2.60.0060.0359.11
5.2.50.0110.0449.08
5.2.40.0120.0559.05
5.2.30.0150.0539.04
5.2.20.0080.0389.02
5.2.10.0090.0368.93
5.2.00.0070.0338.79
5.1.60.0100.0238.08
5.1.50.0050.0288.08
5.1.40.0050.0308.06
5.1.30.0070.0408.41
5.1.20.0090.0358.43
5.1.10.0050.0308.16
5.1.00.0080.0418.15
5.0.50.0050.0236.64
5.0.40.0080.0206.50
5.0.30.0040.0346.30
5.0.20.0070.0286.28
5.0.10.0030.0236.26
5.0.00.0070.0296.25
4.4.90.0040.0164.78
4.4.80.0020.0184.76
4.4.70.0040.0164.76
4.4.60.0030.0184.75
4.4.50.0030.0214.77
4.4.40.0100.0364.71
4.4.30.0040.0244.76
4.4.20.0210.0554.84
4.4.10.0080.0344.84
4.4.00.0040.0334.76
4.3.110.0050.0164.67
4.3.100.0030.0164.66
4.3.90.0020.0174.63
4.3.80.0130.0674.58
4.3.70.0220.0184.63
4.3.60.0090.0204.63
4.3.50.0050.0254.63
4.3.40.0100.0524.54
4.3.30.0050.0233.29
4.3.20.0030.0223.26
4.3.10.0070.0173.23
4.3.00.0070.0206.74

preferences:
47.38 ms | 401 KiB | 5 Q