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();

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.70.0100.01018.55
8.3.60.0130.00716.50
8.3.50.0060.01521.94
8.3.40.0160.00318.97
8.3.30.0110.00419.18
8.3.20.0070.00020.16
8.3.10.0040.00423.60
8.3.00.0060.00617.71
8.2.180.0090.00918.41
8.2.170.0000.01522.96
8.2.160.0140.00020.39
8.2.150.0060.00324.18
8.2.140.0070.00024.66
8.2.130.0070.01126.16
8.2.120.0040.00422.16
8.2.110.0030.00622.27
8.2.100.0060.00617.78
8.2.90.0030.00619.21
8.2.80.0030.00517.97
8.2.70.0100.00017.25
8.2.60.0030.00617.80
8.2.50.0040.00418.07
8.2.40.0030.00618.28
8.2.30.0040.00418.02
8.2.20.0040.00417.61
8.2.10.0000.00717.99
8.2.00.0070.00317.76
8.1.280.0090.00925.92
8.1.270.0060.00322.14
8.1.260.0150.00326.35
8.1.250.0060.00328.09
8.1.240.0060.00323.98
8.1.230.0040.00719.04
8.1.220.0000.00817.76
8.1.210.0080.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0080.00318.61
8.1.160.0040.00422.07
8.1.150.0040.00418.61
8.1.140.0000.00817.50
8.1.130.0040.00417.84
8.1.120.0030.00517.52
8.1.110.0050.00317.46
8.1.100.0000.00717.42
8.1.90.0000.00717.39
8.1.80.0030.00317.35
8.1.70.0000.00717.42
8.1.60.0030.00717.63
8.1.50.0070.00017.48
8.1.40.0070.00017.51
8.1.30.0050.00317.63
8.1.20.0000.00717.65
8.1.10.0000.00717.57
8.1.00.0000.00717.52
8.0.300.0030.00619.27
8.0.290.0000.00717.18
8.0.280.0000.00718.46
8.0.270.0070.00017.27
8.0.260.0030.00317.16
8.0.250.0040.00416.87
8.0.240.0030.00816.90
8.0.230.0030.00316.96
8.0.220.0080.00016.88
8.0.210.0070.00016.92
8.0.200.0040.00416.97
8.0.190.0000.00716.84
8.0.180.0040.00416.95
8.0.170.0000.00816.95
8.0.160.0000.00716.86
8.0.150.0000.00816.91
8.0.140.0040.00416.75
8.0.130.0000.00813.38
8.0.120.0070.00016.86
8.0.110.0000.00716.96
8.0.100.0040.00416.79
8.0.90.0000.00716.74
8.0.80.0090.00616.90
8.0.70.0040.00416.89
8.0.60.0000.00716.80
8.0.50.0030.00516.87
8.0.30.0100.01317.05
8.0.20.0080.01117.40
8.0.10.0000.00816.90
8.0.00.0080.01216.75
7.4.330.0030.00315.00
7.4.320.0030.00316.69
7.4.300.0030.00316.62
7.4.290.0030.00316.46
7.4.280.0070.00016.46
7.4.270.0040.00416.56
7.4.260.0000.00816.58
7.4.250.0040.00416.50
7.4.240.0040.00416.62
7.4.230.0070.00016.52
7.4.220.0030.01416.65
7.4.210.0080.00716.61
7.4.200.0040.00316.72
7.4.190.0090.00016.68
7.4.160.0130.00716.60
7.4.150.0030.01417.40
7.4.140.0070.01217.86
7.4.130.0120.00616.58
7.4.120.0080.01016.43
7.4.110.0100.00716.62
7.4.100.0120.00616.42
7.4.90.0000.01716.57
7.4.80.0120.00619.39
7.4.70.0120.00616.56
7.4.60.0090.01516.61
7.4.50.0000.00816.34
7.4.40.0070.01122.77
7.4.30.0060.01016.22
7.4.00.0050.01214.93
7.3.330.0000.00513.11
7.3.320.0000.00513.28
7.3.310.0030.00316.26
7.3.300.0000.00716.21
7.3.290.0080.00816.25
7.3.280.0090.01016.35
7.3.270.0120.00417.40
7.3.260.0150.00316.41
7.3.250.0100.00916.38
7.3.240.0060.01116.66
7.3.230.0140.00716.39
7.3.210.0060.01216.27
7.3.200.0060.01119.39
7.3.190.0030.01816.66
7.3.180.0130.00316.45
7.3.170.0090.00616.29
7.3.160.0120.00616.29
7.3.120.0100.00714.82
7.3.110.0030.01414.98
7.3.100.0060.01214.66
7.3.90.0120.00014.81
7.3.80.0070.01014.94
7.3.70.0100.00714.62
7.3.60.0140.00014.83
7.3.50.0100.00314.61
7.3.40.0070.01114.49
7.3.30.0070.00714.92
7.3.20.0070.00416.65
7.3.10.0100.00716.53
7.3.00.0060.00716.54
7.2.330.0110.00816.72
7.2.320.0090.00916.65
7.2.310.0070.01016.74
7.2.300.0090.01316.65
7.2.290.0040.01216.95
7.2.250.0070.00414.75
7.2.240.0070.01114.75
7.2.230.0070.00715.25
7.2.220.0110.00415.22
7.2.210.0110.00715.03
7.2.200.0030.00715.01
7.2.190.0090.00614.71
7.2.180.0100.00615.19
7.2.170.0000.01915.12
7.2.160.0050.00515.03
7.2.150.0130.00316.98
7.2.140.0070.00716.70
7.2.130.0060.00916.95
7.2.120.0060.00816.79
7.2.110.0060.01016.92
7.2.100.0080.00716.89
7.2.90.0070.00816.89
7.2.80.0070.00816.90
7.2.70.0090.00716.83
7.2.60.0070.00816.84
7.2.50.0040.00916.80
7.2.40.0080.00816.68
7.2.30.0060.00816.86
7.2.20.0100.00716.95
7.2.10.0050.01016.91
7.2.00.0100.00616.93
7.1.330.0080.00815.35
7.1.320.0100.00315.84
7.1.310.0100.00615.84
7.1.300.0040.01115.80
7.1.290.0040.01515.70
7.1.280.0030.01015.72
7.1.270.0030.01215.69
7.1.260.0090.00615.47
7.1.250.0060.00615.75
7.1.240.0070.00515.68
7.1.230.0100.00515.50
7.1.220.0090.00615.74
7.1.210.0080.00815.52
7.1.200.0170.00515.58
7.1.190.0030.01015.79
7.1.180.0030.00815.65
7.1.170.0080.00715.54
7.1.160.0060.00615.59
7.1.150.0080.00715.62
7.1.140.0050.01015.64
7.1.130.0050.00915.62
7.1.120.0050.00815.73
7.1.110.0100.00715.68
7.1.100.0080.00715.63
7.1.90.0070.00715.55
7.1.80.0040.01215.67
7.1.70.0070.00816.17
7.1.60.0070.01016.88
7.1.50.0080.00915.96
7.1.40.0060.00815.65
7.1.30.0070.00715.52
7.1.20.0090.00715.57
7.1.10.0080.00815.58
7.1.00.0110.02817.69
7.0.330.0060.00515.28
7.0.320.0070.00815.08
7.0.310.0060.00815.22
7.0.300.0050.00715.07
7.0.290.0070.00715.12
7.0.280.0040.00815.39
7.0.270.0100.00515.30
7.0.260.0080.00815.34
7.0.250.0010.01115.17
7.0.240.0060.00715.44
7.0.230.0100.00815.48
7.0.220.0050.01015.14
7.0.210.0060.00815.30
7.0.200.0100.00715.05
7.0.190.0070.00415.12
7.0.180.0090.00515.07
7.0.170.0110.00415.33
7.0.160.0090.00615.33
7.0.150.0090.00815.06
7.0.140.0040.03017.58
7.0.130.0060.01015.45
7.0.120.0070.01115.45
7.0.110.0130.00715.31
7.0.100.0000.01115.36
7.0.90.0060.00915.25
7.0.80.0040.01015.24
7.0.70.0030.03417.37
7.0.60.0070.02717.46
7.0.50.0050.02217.72
7.0.40.0050.01915.65
7.0.30.0080.03315.63
7.0.20.0090.03015.63
7.0.10.0020.02315.64
7.0.00.0050.03315.45
5.6.400.0060.00914.65
5.6.390.0070.00714.60
5.6.380.0050.00813.97
5.6.370.0030.01214.57
5.6.360.0010.00914.19
5.6.350.0060.00614.31
5.6.340.0050.01214.15
5.6.330.0070.00714.14
5.6.320.0070.00514.40
5.6.310.0030.01114.47
5.6.300.0050.01014.14
5.6.290.0070.00814.26
5.6.280.0050.03016.67
5.6.270.0040.01114.46
5.6.260.0050.00614.50
5.6.250.0060.00814.15
5.6.240.0090.00514.51
5.6.230.0030.01014.22
5.6.220.0060.02916.25
5.6.210.0040.03316.28
5.6.200.0090.01916.53
5.6.190.0090.01816.67
5.6.180.0100.03116.43
5.6.170.0060.02416.53
5.6.160.0080.02816.66
5.6.150.0100.02516.55
5.6.140.0060.03016.47
5.6.130.0060.03216.49
5.6.120.0030.03716.46
5.6.110.0080.03216.48
5.6.100.0060.03116.48
5.6.90.0090.01816.55
5.6.80.0070.02216.27
5.6.70.0060.02816.25
5.6.60.0020.02616.29
5.6.50.0080.02916.22
5.6.40.0080.02916.28
5.6.30.0050.02916.15
5.6.20.0080.03416.27
5.6.10.0060.02516.33
5.6.00.0040.02116.29
5.5.380.0080.00412.55
5.5.370.0060.00612.58
5.5.360.0040.03115.26
5.5.350.0040.02515.29
5.5.340.0090.02315.46
5.5.330.0050.01815.43
5.5.320.0090.02915.42
5.5.310.0030.03515.37
5.5.300.0050.03115.31
5.5.290.0040.03515.38
5.5.280.0030.03215.32
5.5.270.0070.03115.55
5.5.260.0110.02815.34
5.5.250.0050.02115.17
5.5.240.0050.02115.23
5.5.230.0060.02915.17
5.5.220.0050.02615.19
5.5.210.0030.02715.25
5.5.200.0080.02015.18
5.5.190.0050.03115.05
5.5.180.0040.03415.29
5.5.170.0030.00612.56
5.5.160.0010.02615.21
5.5.150.0030.03415.19
5.5.140.0080.02015.26
5.5.130.0050.03314.99
5.5.120.0030.02615.11
5.5.110.0110.01815.05
5.5.100.0020.02615.02
5.5.90.0070.03315.16
5.5.80.0030.03315.16
5.5.70.0080.02915.11
5.5.60.0090.02715.11
5.5.50.0040.02315.04
5.5.40.0050.02915.09
5.5.30.0040.03515.04
5.5.20.0080.03115.19
5.5.10.0070.03015.17
5.5.00.0060.02015.17
5.4.450.0080.02914.18
5.4.440.0040.03314.22
5.4.430.0030.03114.22
5.4.420.0020.03614.21
5.4.410.0040.02514.21
5.4.400.0070.02714.17
5.4.390.0040.02714.02
5.4.380.0070.02514.03
5.4.370.0040.03114.10
5.4.360.0060.02214.10
5.4.350.0050.03114.09
5.4.340.0050.02514.04
5.4.330.0080.00111.63
5.4.320.0060.02914.12
5.4.310.0030.02514.12
5.4.300.0060.02614.06
5.4.290.0060.02814.19
5.4.280.0060.02714.10
5.4.270.0040.03014.08
5.4.260.0060.02914.12
5.4.250.0080.02914.02
5.4.240.0060.02514.14
5.4.230.0080.02814.11
5.4.220.0040.03214.06
5.4.210.0020.03314.10
5.4.200.0050.02914.13
5.4.190.0050.02814.07
5.4.180.0080.02514.02
5.4.170.0030.03014.15
5.4.160.0070.02614.08
5.4.150.0020.01914.04
5.4.140.0030.03013.23
5.4.130.0020.02313.20
5.4.120.0030.02013.18
5.4.110.0070.02613.23
5.4.100.0070.02613.27
5.4.90.0030.03113.27
5.4.80.0080.02213.25
5.4.70.0030.02713.20
5.4.60.0030.03013.19
5.4.50.0100.01613.24
5.4.40.0030.03013.23
5.4.30.0070.02613.21
5.4.20.0060.02613.27
5.4.10.0070.02513.22
5.4.00.0060.02413.04
5.3.290.0050.02412.62
5.3.280.0060.03512.60
5.3.270.0050.03112.62
5.3.260.0050.02012.58
5.3.250.0020.03212.60
5.3.240.0030.03112.60
5.3.230.0060.02312.61
5.3.220.0020.02812.62
5.3.210.0010.02112.57
5.3.200.0030.03212.61
5.3.190.0010.03112.58
5.3.180.0020.02212.58
5.3.170.0030.01612.57
5.3.160.0050.01912.61
5.3.150.0030.03012.58
5.3.140.0020.01612.62
5.3.130.0060.02012.58
5.3.120.0050.02912.56
5.3.110.0030.03112.58
5.3.100.0040.02712.40
5.3.90.0040.03012.45
5.3.80.0040.03012.38
5.3.70.0060.02712.40
5.3.60.0070.02912.38
5.3.50.0020.02912.42
5.3.40.0020.02712.41
5.3.30.0030.01612.34
5.3.20.0060.02512.32
5.3.10.0030.02612.33
5.3.00.0030.03012.27
5.2.170.0020.03511.62
5.2.160.0020.02511.62
5.2.150.0050.02211.62
5.2.140.0030.02611.62
5.2.130.0000.03611.62
5.2.120.0020.03611.62
5.2.110.0050.03011.62
5.2.100.0070.03211.62
5.2.90.0030.03011.62
5.2.80.0070.03011.62
5.2.70.0020.03711.62
5.2.60.0050.02711.62
5.2.50.0050.03311.62
5.2.40.0020.03611.62
5.2.30.0040.03411.62
5.2.20.0040.02511.62
5.2.10.0020.03211.62
5.2.00.0050.02511.62
5.1.60.0030.02011.62
5.1.50.0020.02811.62
5.1.40.0010.02611.62
5.1.30.0000.01811.62
5.1.20.0020.01511.62
5.1.10.0060.02311.62
5.1.00.0030.01311.62
5.0.50.0040.01111.62
5.0.40.0000.01411.62
5.0.30.0020.01711.62
5.0.20.0020.01411.62
5.0.10.0020.01211.62
5.0.00.0000.02111.62
4.4.90.0000.02311.62
4.4.80.0030.01811.62
4.4.70.0020.01711.62
4.4.60.0020.01411.62
4.4.50.0030.01011.62
4.4.40.0000.01811.62
4.4.30.0020.02011.62
4.4.20.0020.01711.62
4.4.10.0020.01411.62
4.4.00.0000.02011.62
4.3.110.0020.01011.62
4.3.100.0000.01311.62
4.3.90.0030.00711.62
4.3.80.0030.02711.62
4.3.70.0010.01011.62
4.3.60.0010.00811.62
4.3.50.0010.01011.62
4.3.40.0000.01511.62
4.3.30.0000.01111.62
4.3.20.0030.00811.62
4.3.10.0020.01011.62
4.3.00.0030.00911.62

preferences:
51.36 ms | 401 KiB | 5 Q