3v4l.org

run code in 300+ PHP versions simultaneously
<?php class friendList { private $friends = []; public __construct(array $names=[]){ foreach($names){$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);

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)
5.4.320.0070.06318.98
5.4.310.0000.03719.23
5.4.300.0070.03719.22
5.4.290.0030.03319.24
5.4.280.0030.04019.15
5.4.270.0030.05018.85
5.4.260.0030.03719.25
5.4.250.0000.04019.21
5.4.240.0000.03718.99
5.4.230.0000.04019.08
5.4.220.0000.04019.05
5.4.210.0030.03719.05
5.4.200.0030.05018.97
5.4.190.0030.06019.07
5.4.180.0030.03719.14
5.4.170.0030.07319.20
5.4.160.0030.07319.06
5.4.150.0030.04319.20
5.4.140.0000.03716.49
5.4.130.0000.03716.38
5.4.120.0000.03716.44
5.4.110.0030.03316.37
5.4.100.0000.04316.58
5.4.90.0000.03716.26
5.4.80.0000.04716.44
5.4.70.0030.03316.54
5.4.60.0000.03316.38
5.4.50.0030.03316.54
5.4.40.0000.03716.16
5.4.30.0100.03316.50
5.4.20.0030.03716.53
5.4.10.0030.03316.42
5.4.00.0030.03015.80
5.3.290.0070.03314.66
5.3.280.0000.04714.74
5.3.270.0000.04314.52
5.3.260.0130.04714.58
5.3.250.0030.04014.51
5.3.240.0000.04014.65
5.3.230.0000.04014.66
5.3.220.0000.04714.64
5.3.210.0100.04014.78
5.3.200.0000.04314.67
5.3.190.0000.03714.67
5.3.180.0000.04714.55
5.3.170.0000.04014.48
5.3.160.0000.03714.48
5.3.150.0000.05014.64
5.3.140.0070.03014.63
5.3.130.0000.03714.47
5.3.120.0000.03714.56
5.3.110.0030.04314.46
5.3.100.0000.03714.15
5.3.90.0000.04014.07
5.3.80.0000.03714.10
5.3.70.0070.03014.02
5.3.60.0000.04013.94
5.3.50.0030.04313.86
5.3.40.0000.03313.86
5.3.30.0030.03313.98
5.3.20.0000.03713.59
5.3.10.0000.03713.66
5.3.00.0000.03713.72
5.2.170.0030.02711.66
5.2.160.0030.03311.66
5.2.150.0030.02711.66
5.2.140.0000.03011.66
5.2.130.0000.03011.66
5.2.120.0070.02311.66
5.2.110.0030.02711.66
5.2.100.0000.02711.66
5.2.90.0000.02711.66
5.2.80.0000.03011.66
5.2.70.0000.03011.66
5.2.60.0000.03011.66
5.2.50.0000.03311.66
5.2.40.0070.02711.66
5.2.30.0030.03311.66
5.2.20.0030.02711.66
5.2.10.0070.02311.66
5.2.00.0000.03011.66
5.1.60.0000.02711.66
5.1.50.0030.02311.66
5.1.40.0030.02711.66
5.1.30.0030.02311.66
5.1.20.0030.03011.66
5.1.10.0030.02311.66
5.1.00.0000.03311.66
5.0.50.0000.02011.66
5.0.40.0070.02311.66
5.0.30.0030.03011.66
5.0.20.0000.02011.66
5.0.10.0030.01711.66
5.0.00.0000.03011.66
4.4.90.0070.01711.66
4.4.80.0030.01011.66
4.4.70.0000.01311.66
4.4.60.0000.01711.66
4.4.50.0000.01311.66
4.4.40.0000.02311.66
4.4.30.0000.01711.66
4.4.20.0030.02011.66
4.4.10.0000.01711.66
4.4.00.0000.02311.66
4.3.110.0000.01311.66
4.3.100.0000.01311.66
4.3.90.0000.01311.66
4.3.80.0000.02711.66
4.3.70.0000.01311.66
4.3.60.0000.01711.66
4.3.50.0030.01311.66
4.3.40.0000.02311.66
4.3.30.0000.01711.66
4.3.20.0030.01311.66
4.3.10.0070.01011.66
4.3.00.0000.01711.66

preferences:
148.61 ms | 1394 KiB | 7 Q