3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class friendList { private $friends; public function __construct(array $names=[]){ $this->friends = []; foreach($names as $name){$this->addFriend($name);} } public function addFriend($name) { $friends[] = $name; } public function getFriends() { return $friends; } } $friends = new friendList(['Eric','Dan','Lisa']); function funtimes($friends) { echo implode(", ", $friends->getFriends()); $this->addFriend('John'); } funtimes($data); var_dump($data);
based on ABLGX

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).
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.0rc40.0530.00398.97
7.3.0rc30.0330.00916.33
7.3.0beta10.0070.00412.65
7.3.0alpha10.0040.00412.83
7.2.60.0230.00016.37
7.2.00.0000.01519.33
7.1.200.0000.01015.70
7.1.100.0000.01118.25
7.1.70.0030.01017.07
7.1.60.0030.01519.40
7.1.50.0040.01417.08
7.1.00.0000.08022.52
7.0.200.0580.01014.98
7.0.140.0070.07022.04
7.0.60.0070.08319.82
7.0.50.0070.08017.88
7.0.40.0300.04720.27
7.0.30.0300.07320.30
7.0.20.0270.08320.15
7.0.10.0030.04720.33
7.0.00.0030.08720.21
5.6.280.0030.07321.00
5.6.210.0130.08320.51
5.6.200.0130.03018.14
5.6.190.0130.03720.63
5.6.180.0470.07020.77
5.6.170.0300.03720.62
5.6.160.0070.04020.54
5.6.150.0030.08318.23
5.6.140.0100.03718.28
5.6.130.0100.06318.23
5.6.120.0130.05721.02
5.6.110.0070.07721.00
5.6.100.0070.08721.14
5.6.90.0070.07021.00
5.6.80.0070.08320.30
5.5.350.0130.09020.31
5.5.340.0070.05017.95
5.5.330.0100.07720.43
5.5.320.3330.03720.33
5.5.310.0270.07320.30
5.5.300.0070.03717.99
5.5.290.0070.05318.07
5.5.280.0000.04720.81
5.5.270.0070.05720.95
5.5.260.0070.03720.80
5.5.250.0070.03720.60
5.5.240.0030.06320.05
5.4.450.0170.06719.50
5.4.440.0800.05719.48
5.4.430.0070.05719.54
5.4.420.0130.05319.55
5.4.410.0130.05319.05
5.4.400.0200.04018.77
5.4.390.0100.05718.57
5.4.380.0070.06018.70
5.4.370.0100.04018.57
5.4.360.0130.04318.55
5.4.350.0100.04712.02
5.4.340.0080.03712.02
5.4.320.0040.03912.51
5.4.310.0030.04112.50
5.4.300.0100.03612.51
5.4.290.0080.04612.50
5.4.280.0060.03412.40
5.4.270.0050.03712.40
5.4.260.0070.03612.40
5.4.250.0070.03912.40
5.4.240.0070.03512.41
5.4.230.0040.04012.39
5.4.220.0040.03812.39
5.4.210.0020.03912.40
5.4.200.0060.04412.39
5.4.190.0080.03812.39
5.4.180.0060.03612.39
5.4.170.0060.04012.40
5.4.160.0070.03412.39
5.4.150.0100.03612.39
5.4.140.0070.04012.07
5.4.130.0080.03412.06
5.4.120.0070.03312.02
5.4.110.0070.03712.02
5.4.100.0070.03412.02
5.4.90.0060.03612.02
5.4.80.0040.03812.02
5.4.70.0060.03412.02
5.4.60.0040.03612.01
5.4.50.0030.03812.02
5.4.40.0040.04112.00
5.4.30.0040.03712.00
5.4.20.0060.03512.00
5.4.10.0060.03412.00
5.4.00.0070.03911.49
5.3.290.0060.03912.80
5.3.280.0050.04212.71
5.3.270.0050.03912.72
5.3.260.0050.04012.72
5.3.250.0060.03712.72
5.3.240.0130.03012.71
5.3.230.0050.03812.71
5.3.220.0080.04312.68
5.3.210.0060.03812.68
5.3.200.0060.03612.68
5.3.190.0110.03212.68
5.3.180.0040.03812.67
5.3.170.0060.03612.67
5.3.160.0060.03612.67
5.3.150.0060.03712.67
5.3.140.0090.03812.66
5.3.130.0080.03712.66
5.3.120.0060.03812.65
5.3.110.0090.03612.66
5.3.100.0060.03712.13
5.3.90.0050.03712.11
5.3.80.0040.03912.09
5.3.70.0050.03612.09
5.3.60.0050.03612.08
5.3.50.0080.03312.03
5.3.40.0010.04112.03
5.3.30.0050.03711.98
5.3.20.0050.03611.76
5.3.10.0040.03611.73
5.3.00.0080.03411.71
5.2.170.0040.0319.22
5.2.160.0080.0259.22
5.2.150.0030.0319.22
5.2.140.0040.0319.21
5.2.130.0040.0299.18
5.2.120.0050.0279.18
5.2.110.0070.0279.18
5.2.100.0060.0279.18
5.2.90.0040.0309.18
5.2.80.0080.0309.18
5.2.70.0060.0309.18
5.2.60.0070.0289.13
5.2.50.0040.0319.09
5.2.40.0050.0289.07
5.2.30.0040.0319.05
5.2.20.0050.0289.04
5.2.10.0040.0298.95
5.2.00.0040.0308.80
5.1.60.0020.0308.09
5.1.50.0050.0278.08
5.1.40.0020.0278.07
5.1.30.0030.0278.42
5.1.20.0030.0278.44
5.1.10.0040.0268.16
5.1.00.0030.0278.16
5.0.50.0050.0196.64
5.0.40.0030.0196.50
5.0.30.0020.0326.32
5.0.20.0040.0186.28
5.0.10.0020.0226.26
5.0.00.0040.0306.25
4.4.90.0050.0164.78
4.4.80.0050.0134.76
4.4.70.0020.0174.75
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0020.0254.71
4.4.30.0040.0144.76
4.4.20.0020.0164.84
4.4.10.0020.0164.85
4.4.00.0030.0244.76
4.3.110.0020.0214.67
4.3.100.0030.0144.66
4.3.90.0010.0164.63
4.3.80.0030.0244.59
4.3.70.0010.0184.63
4.3.60.0020.0154.63
4.3.50.0050.0174.63
4.3.40.0030.0244.54
4.3.30.0020.0173.30
4.3.20.0020.0163.28
4.3.10.0010.0203.23
4.3.00.0030.0236.80