3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements Countable { public $prop1, $prop2,$prop3,$prop4; private $propa, $propb,$propc,$propd; protected $propx, $propy,$propz,$propzz; public function Greet() { return 'hello world'; } public function getCount() { $res = (array) $this; return count($res); } public function count() { return $this->getCount(); } } $t = new Test; echo $t->Greet(),"\n"; echo count( (array) $t),"\n"; echo $t->getCount(),"\n"; echo count($t),"\n"; echo count( array_keys(get_object_vars($t)));

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.00716.63
8.3.50.0100.00822.06
8.3.40.0100.00718.84
8.3.30.0100.00319.04
8.3.20.0000.00720.16
8.3.10.0000.00823.61
8.3.00.0040.00819.26
8.2.180.0120.00318.29
8.2.170.0040.01122.96
8.2.160.0100.00320.52
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0040.00419.35
8.2.110.0060.00322.24
8.2.100.0030.00917.91
8.2.90.0040.00419.27
8.2.80.0000.00818.03
8.2.70.0210.00017.13
8.2.60.0050.00317.93
8.2.50.0060.00318.07
8.2.40.0040.00418.16
8.2.30.0050.00318.06
8.2.20.0040.00417.68
8.2.10.0040.00418.06
8.2.00.0070.00317.73
8.1.280.0130.00325.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00623.82
8.1.230.0040.00719.12
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0040.00417.63
8.1.180.0000.00818.10
8.1.170.0050.00318.64
8.1.160.0030.00621.96
8.1.150.0030.00518.51
8.1.140.0040.00417.32
8.1.130.0000.00717.87
8.1.120.0020.00517.47
8.1.110.0040.00417.49
8.1.100.0040.00417.40
8.1.90.0040.00417.47
8.1.80.0070.00017.38
8.1.70.0030.00317.38
8.1.60.0090.00017.59
8.1.50.0000.00817.53
8.1.40.0050.00317.50
8.1.30.0030.00517.58
8.1.20.0040.00417.67
8.1.10.0000.00717.60
8.1.00.0050.00317.48
8.0.300.0050.00218.77
8.0.290.0030.00617.18
8.0.280.0000.00718.35
8.0.270.0050.00317.16
8.0.260.0060.00017.25
8.0.250.0070.00016.93
8.0.240.0030.00616.96
8.0.230.0070.00016.90
8.0.220.0030.00316.91
8.0.210.0040.00416.85
8.0.200.0000.00816.94
8.0.190.0030.00316.98
8.0.180.0050.00316.89
8.0.170.0050.00316.84
8.0.160.0040.00416.87
8.0.150.0040.00416.79
8.0.140.0000.00716.90
8.0.130.0030.00613.32
8.0.120.0050.00216.83
8.0.110.0080.00016.79
8.0.100.0000.00716.76
8.0.90.0040.00416.75
8.0.80.0030.01016.81
8.0.70.0030.00516.69
8.0.60.0040.00416.95
8.0.50.0000.00816.92
8.0.30.0140.00817.09
8.0.20.0130.00917.40
8.0.10.0000.00716.98
8.0.00.0110.00716.58
7.4.330.0000.00615.09
7.4.320.0030.00316.42
7.4.300.0000.00716.51
7.4.290.0060.00316.62
7.4.280.0050.00316.59
7.4.270.0000.00716.40
7.4.260.0070.00016.42
7.4.250.0000.00716.54
7.4.240.0000.00716.49
7.4.230.0000.00716.58
7.4.220.0140.00416.50
7.4.210.0080.00816.59
7.4.200.0050.00516.34
7.4.190.0000.00816.76
7.4.160.0070.01016.53
7.4.150.0120.00817.40
7.4.140.0100.00817.86
7.4.130.0030.01516.49
7.4.120.0050.01316.60
7.4.110.0070.01016.56
7.4.100.0150.00316.50
7.4.90.0080.00916.58
7.4.80.0160.00319.39
7.4.70.0080.00816.38
7.4.60.0030.01416.59
7.4.50.0020.00216.48
7.4.40.0040.01122.77
7.4.30.0090.00616.54
7.4.00.0090.00615.02
7.3.330.0050.00013.38
7.3.320.0030.00313.12
7.3.310.0030.00316.29
7.3.300.0030.00316.23
7.3.290.0090.00616.30
7.3.280.0100.00716.31
7.3.270.0130.00317.40
7.3.260.0130.00416.44
7.3.250.0110.01016.47
7.3.240.0150.00616.50
7.3.230.0060.00916.40
7.3.210.0110.00716.61
7.3.200.0060.01319.39
7.3.190.0070.01116.25
7.3.180.0100.01016.62
7.3.170.0030.01216.53
7.3.160.0060.00916.56
7.3.120.0040.01114.98
7.2.330.0170.00016.84
7.2.320.0080.00816.46
7.2.310.0060.01116.81
7.2.300.0060.00916.69
7.2.290.0100.01016.81
7.2.60.0030.00716.93
7.1.200.0000.01415.61
7.1.70.0090.00617.22
7.1.60.0100.01419.33
7.1.50.0040.01716.56
7.1.00.0000.08022.44
7.0.200.0400.00414.48
7.0.140.0070.07022.10
7.0.60.0170.07319.82
7.0.50.0100.07717.91
7.0.40.0100.09020.02
7.0.30.0400.08320.17
7.0.20.0270.08020.08
7.0.10.0070.09020.24
7.0.00.0030.04320.20
5.6.280.0000.07720.83
5.6.210.0100.07720.57
5.6.200.0100.08318.15
5.6.190.0030.04720.67
5.6.180.0200.04020.48
5.6.170.0230.06020.71
5.6.160.0030.08720.47
5.6.150.0030.04018.28
5.6.140.0070.06318.21
5.6.130.0070.03718.21
5.6.120.0000.05321.00
5.6.110.0100.09021.09
5.6.100.0070.09020.98
5.6.90.0030.05321.12
5.6.80.0100.07320.48
5.6.70.4070.04020.38
5.5.350.0130.03320.33
5.5.340.0070.08018.08
5.5.330.0100.04720.27
5.5.320.0130.04320.20
5.5.310.0370.04720.50
5.5.300.0100.06718.00
5.5.290.0100.03317.94
5.5.280.0170.06020.86
5.5.270.0000.04320.68
5.5.260.0030.04320.88
5.5.250.0030.05320.63
5.5.240.0130.07320.05
5.4.450.0830.04319.59
5.4.440.0670.07019.61
5.4.430.0130.05719.47
5.4.420.1100.07019.67
5.4.410.1000.04719.48
5.4.400.0730.06719.38
5.4.390.0770.05718.84
5.4.380.0330.05318.73
5.4.370.0270.06718.79
5.4.360.0600.06718.76
5.4.350.0470.05318.76
5.4.340.0630.06018.75
5.4.320.0070.04612.51
5.4.310.0050.04312.50
5.4.300.0080.03712.51
5.4.290.0040.04012.50
5.4.280.0100.05212.38
5.4.270.0130.05212.37
5.4.260.0070.06612.38
5.4.250.0070.05812.38
5.4.240.0130.04812.38
5.4.230.0120.04812.36
5.4.220.0060.05012.37
5.4.210.0060.04712.36
5.4.200.0080.05012.37
5.4.190.0110.04512.36
5.4.180.0100.04812.36
5.4.170.0070.05312.38
5.4.160.0120.04912.37
5.4.150.0130.04212.37
5.4.140.0080.03612.05
5.4.130.0070.03612.04
5.4.120.0060.03912.00
5.4.110.0070.03612.00
5.4.100.0070.03812.00
5.4.90.0080.03811.99
5.4.80.0080.03711.99
5.4.70.0040.03911.99
5.4.60.0040.04411.99
5.4.50.0080.05111.99
5.4.40.0110.04611.98
5.4.30.0050.04911.97
5.4.20.0060.04311.98
5.4.10.0070.04911.98
5.4.00.0060.04411.46
5.3.290.0040.04112.80
5.3.280.0070.05812.71
5.3.270.0120.05512.72
5.3.260.0110.05612.72
5.3.250.0100.05212.71
5.3.240.0100.05412.72
5.3.230.0070.05812.71
5.3.220.0110.05112.68
5.3.210.0080.06112.68
5.3.200.0130.07212.68
5.3.190.0130.06012.68
5.3.180.0160.06012.67
5.3.170.0090.05612.66
5.3.160.0100.05412.68
5.3.150.0110.05412.67
5.3.140.0160.05112.66
5.3.130.0120.05912.66
5.3.120.0130.06812.66
5.3.110.0100.05012.66
5.3.100.0130.04912.12
5.3.90.0160.05012.08
5.3.80.0140.04812.07
5.3.70.0100.05212.07
5.3.60.0090.04912.06
5.3.50.0110.05012.01
5.3.40.0150.04512.01
5.3.30.0120.04711.96
5.3.20.0090.04611.75
5.3.10.0050.05111.71
5.3.00.0100.05311.70
5.2.170.0070.0469.20
5.2.160.0060.0469.20
5.2.150.0080.0469.20
5.2.140.0100.0419.20
5.2.130.0060.0449.16
5.2.120.0060.0439.16
5.2.110.0090.0449.17
5.2.100.0080.0439.17
5.2.90.0090.0389.16
5.2.80.0080.0459.16
5.2.70.0190.0639.16
5.2.60.0080.0549.10
5.2.50.0110.0499.08
5.2.40.0090.0439.05
5.2.30.0100.0479.04
5.2.20.0070.0409.02
5.2.10.0070.0398.93
5.2.00.0090.0418.79
5.1.60.0110.0418.07
5.1.50.0100.0348.08
5.1.40.0090.0448.07
5.1.30.0120.0448.41
5.1.20.0110.0638.43
5.1.10.0100.0328.15
5.1.00.0080.0258.15
5.0.50.0030.0276.63
5.0.40.0070.0256.48
5.0.30.0040.0356.30
5.0.20.0040.0226.27
5.0.10.0060.0246.25
5.0.00.0040.0336.24
4.4.90.0030.0194.78
4.4.80.0040.0214.75
4.4.70.0050.0204.75
4.4.60.0040.0214.75
4.4.50.0020.0224.77
4.4.40.0030.0324.71
4.4.30.0050.0224.76
4.4.20.0030.0204.84
4.4.10.0060.0204.85
4.4.00.0030.0364.76
4.3.110.0050.0224.67
4.3.100.0040.0214.66
4.3.90.0020.0184.63
4.3.80.0060.0294.59
4.3.70.0000.0364.63
4.3.60.0070.0294.63
4.3.50.0060.0204.63
4.3.40.0040.0364.54
4.3.30.0020.0223.29
4.3.20.0070.0193.26
4.3.10.0030.0233.23
4.3.00.0170.0207.79

preferences:
41.93 ms | 401 KiB | 5 Q