3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Connection { public $server, $username, $password, $db; public function __construct($server, $username, $password, $db) { $this->server = $server; $this->username = $username; $this->password = $password; $this->db = $db; } public function __sleep() { return array('server', 'username', 'password', 'db'); } public function __wakeup() { return implode(',',array( $this->server = $server,$this->username = $username, $this->password = $password, $this->db = $db); } public function a(){ echo $this->server; echo $this->username; echo $this->password; echo $this->db; } } /*$server="server1"; $username="username1"; $password="password1"; $db="db1";*/ $conect= new Connection("server1", "username1", "password1", "db1"); $conect->a(); echo $conect->__wakeup(); ?>

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.5.30.0000.06317.18
5.5.20.0000.08017.22
5.5.10.0000.08717.22
5.5.00.0130.05717.25
5.4.190.0100.05318.97
5.4.180.0170.05319.11
5.4.170.0030.06719.02
5.4.160.0130.07019.12
5.4.150.0070.07019.25
5.4.140.0130.04016.39
5.4.130.0070.07316.38
5.4.120.0070.04316.39
5.4.110.0030.03716.39
5.4.100.0030.04016.23
5.4.90.0030.03716.40
5.4.80.0030.03316.48
5.4.70.0100.03016.46
5.4.60.0030.03716.38
5.4.50.0030.03316.57
5.4.40.0070.03716.47
5.4.30.0070.03716.35
5.4.20.0070.03016.35
5.4.10.0000.04016.31
5.4.00.0030.03315.83
5.3.270.0100.07314.71
5.3.260.0000.04714.46
5.3.250.0030.03714.61
5.3.240.0030.04314.65
5.3.230.0170.05314.65
5.3.220.0100.03714.64
5.3.210.0000.04014.65
5.3.200.0000.04314.64
5.3.190.0000.04314.58
5.3.180.0030.04014.42
5.3.170.0100.03314.42
5.3.160.0030.03714.60
5.3.150.0030.03314.78
5.3.140.0000.03714.66
5.3.130.0000.04314.77
5.3.120.0000.04014.62
5.3.110.0030.07314.54
5.3.100.0000.03714.14
5.3.90.0000.03713.99
5.3.80.0000.03714.05
5.3.70.0000.03714.12
5.3.60.0000.03713.90
5.3.50.0070.03713.97
5.3.40.0030.03714.01
5.3.30.0070.03313.98
5.3.20.0000.03713.75
5.3.10.0100.02713.57
5.3.00.0030.03313.73

preferences:
139.57 ms | 1394 KiB | 7 Q