3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo 'count(false): ',count(false),"\n"; echo 'count(0): ',count(0),"\n"; echo 'count(array(false)): ',count(array(false)),"\n"; echo 'count(array(0)): ',count(array(0)),"\n"; echo 'count(null): ',count(null),"\n"; echo 'count(array()): ',count(array()),"\n"; class Test {} $t = new Test(); echo 'count($t): ', count($t), "\n"; // not empty; see below: echo 'empty(null):', empty(null), "\n"; echo 'empty(array():',empty(array()),"\n"; // obj w/no properties not empty PHP5+ echo 'empty($t):',empty($t),"\n";

Here you find the average performance (time & memory) of each version. A greyed out version indicates it didn't complete successfully (based on exit-code).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.0beta10.0000.01112.59
7.3.0alpha10.0030.00612.58
7.2.60.0030.01316.74
7.2.00.0000.01419.49
7.1.200.0070.00815.42
7.1.100.0000.00918.12
7.1.70.0000.01317.00
7.1.60.0140.01019.33
7.1.50.0000.01516.58
7.1.00.0000.08022.31
7.0.200.0650.00614.44
7.0.140.0070.06721.95
7.0.60.0100.04019.95
7.0.50.0070.04017.89
7.0.40.0070.08320.08
7.0.30.0270.07720.30
7.0.20.0130.04720.06
7.0.10.0100.07020.44
7.0.00.0070.08320.07
5.6.280.0030.07721.07
5.6.210.0100.05720.71
5.6.200.0030.04018.16
5.6.190.0100.07320.47
5.6.180.0230.08020.33
5.6.170.0200.05720.47
5.6.160.0070.08720.54
5.6.150.0030.05318.15
5.6.140.0030.04018.28
5.6.130.0100.06018.23
5.6.120.0130.06320.99
5.6.110.0100.08021.09
5.6.100.0030.04021.00
5.6.90.0130.07720.98
5.6.80.0100.07320.39
5.6.70.4630.03720.35
5.5.350.0030.08020.32
5.5.340.0070.08017.95
5.5.330.0030.05320.37
5.5.320.0200.08320.27
5.5.310.0270.04720.38
5.5.300.0070.08318.08
5.5.290.0030.06017.98
5.5.280.0030.05720.88
5.5.270.0130.07720.86
5.5.260.0130.07720.73
5.5.250.0030.09020.80
5.5.240.0000.05720.16
5.4.450.0830.03719.31
5.4.440.0770.05719.66
5.4.430.0770.05719.31
5.4.420.0730.05719.48
5.4.410.0970.04719.10
5.4.400.0300.04319.13
5.4.390.0670.06019.00
5.4.380.0130.05718.80
5.4.370.0070.06718.50
5.4.360.0200.05018.47
5.4.350.0200.05718.63
5.4.340.0300.04018.64
5.4.320.0060.03812.52
5.4.310.0040.04012.51
5.4.300.0080.04012.52
5.4.290.0110.04412.51
5.4.280.0090.04812.38
5.4.270.0150.04412.38
5.4.260.0080.05612.38
5.4.250.0100.05412.38
5.4.240.0100.04812.38
5.4.230.0100.04012.37
5.4.220.0110.04912.37
5.4.210.0070.05312.37
5.4.200.0080.04612.37
5.4.190.0100.03512.36
5.4.180.0080.04312.36
5.4.170.0090.04612.37
5.4.160.0060.04612.37
5.4.150.0060.04712.36
5.4.140.0090.04012.06
5.4.130.0160.06112.04
5.4.120.0190.06412.00
5.4.110.0130.04612.00
5.4.100.0080.03612.00
5.4.90.0120.04712.00
5.4.80.0060.04012.00
5.4.70.0110.04612.00
5.4.60.0070.04512.00
5.4.50.0040.04011.99
5.4.40.0060.04111.99
5.4.30.0110.03411.98
5.4.20.0050.03711.98
5.4.10.0080.03411.98
5.4.00.0040.03811.48
5.3.290.0080.04612.80
5.3.280.0040.04112.70
5.3.270.0070.04412.72
5.3.260.0090.03712.72
5.3.250.0080.04012.72
5.3.240.0070.03812.72
5.3.230.0080.04112.71
5.3.220.0130.03412.68
5.3.210.0120.04112.68
5.3.200.0100.03412.68
5.3.190.0080.04012.68
5.3.180.0100.03912.68
5.3.170.0070.03712.67
5.3.160.0060.03912.68
5.3.150.0070.03912.68
5.3.140.0080.03912.66
5.3.130.0080.04012.65
5.3.120.0060.04112.66
5.3.110.0130.03912.66
5.3.100.0120.04512.12
5.3.90.0120.05712.09
5.3.80.0090.05912.07
5.3.70.0060.04012.07
5.3.60.0080.03812.07
5.3.50.0070.03812.00
5.3.40.0080.04112.00
5.3.30.0100.03711.95
5.3.20.0100.04411.74
5.3.10.0090.06211.70
5.3.00.0090.05311.69
5.2.170.0070.0419.18
5.2.160.0090.0379.18
5.2.150.0150.0369.18
5.2.140.0060.0489.18
5.2.130.0120.0399.14
5.2.120.0060.0429.14
5.2.110.0110.0359.15
5.2.100.0050.0419.14
5.2.90.0060.0369.14
5.2.80.0050.0339.14
5.2.70.0050.0359.14
5.2.60.0100.0409.09
5.2.50.0050.0419.07
5.2.40.0060.0299.04
5.2.30.0050.0389.02
5.2.20.0050.0329.00
5.2.10.0050.0308.92
5.2.00.0060.0298.79
5.1.60.0050.0348.07
5.1.50.0090.0328.07
5.1.40.0060.0318.05
5.1.30.0030.0278.39
5.1.20.0040.0278.42
5.1.10.0040.0278.14
5.1.00.0040.0268.14
5.0.50.0030.0226.62
5.0.40.0030.0206.48
5.0.30.0040.0326.29
5.0.20.0040.0236.26
5.0.10.0070.0176.24
5.0.00.0050.0296.23
4.4.90.0020.0214.78
4.4.80.0030.0154.76
4.4.70.0030.0154.76
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0020.0264.71
4.4.30.0050.0134.76
4.4.20.0020.0174.84
4.4.10.0020.0164.85
4.4.00.0030.0254.76
4.3.110.0010.0184.67
4.3.100.0050.0124.67
4.3.90.0030.0154.63
4.3.80.0030.0254.59
4.3.70.0040.0154.63
4.3.60.0030.0204.63
4.3.50.0050.0194.63
4.3.40.0040.0294.54
4.3.30.0030.0203.29
4.3.20.0020.0183.27
4.3.10.0030.0193.23
4.3.00.0270.01313.47