3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public string $name = ""; public string $password = ""; public int $admin = 0; public string $fullName = ""; public function __construct(string $name, string $password, int $admin) { $this->name = $name; $this->password= $password; $this->admin = $admin; } public function __wakeup() { $this->fullName = $this->name . $this->password; } } $user_test = new User("Sebastian", "Password", 1); var_dump($user_test); var_dump(serialize($user_test)); $other_user = unserialize('O:4:"User":3:{s:4:"name";s:9:"Sebastian";s:8:"password";s:8:"Password";s:5:"admin";i:2;}'); var_dump($other_user);

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.1rc10.0040.00416.96
8.0.100.0040.00417.01
8.0.90.0000.00816.87
8.0.80.0030.01216.98
8.0.70.0050.00216.93
8.0.60.0040.00416.85
8.0.50.0000.00817.09
8.0.30.0250.00916.78
8.0.20.0270.00816.96
8.0.10.0270.01116.86
8.0.00.0180.01316.90
7.4.230.0000.00916.65
7.4.220.0000.00716.36
7.4.210.0110.00316.49
7.4.200.0000.00716.42
7.4.160.0100.01116.38
7.4.150.0260.00716.39
7.4.140.0270.00316.31
7.4.130.0250.01216.31
7.4.120.0300.01816.33
7.4.110.0270.00716.40
7.4.100.0220.01116.38
7.4.90.0280.00716.45
7.4.80.0270.00716.34
7.4.70.0270.00616.50
7.4.60.0200.01116.31
7.4.50.0250.00716.32
7.4.40.0200.00916.43
7.4.30.0230.01316.58
7.4.20.0250.01016.42
7.4.10.0190.01116.48
7.4.00.0290.00816.43
7.3.300.0030.00316.17
7.3.290.0090.00916.19
7.3.280.0270.00516.01
7.3.270.0240.01116.13
7.3.260.0210.01216.11
7.3.250.0210.00616.12
7.3.240.0240.00916.04
7.3.230.0290.01216.11
7.3.220.0250.00616.00
7.3.210.0260.01016.07
7.3.200.0210.01115.96
7.3.190.0270.00715.99
7.3.180.0230.01316.07
7.3.170.0300.00315.98
7.3.160.0280.00716.05
7.3.150.0170.01716.03
7.3.140.0310.00316.05
7.3.130.0170.01716.00
7.3.120.0210.01616.07
7.3.110.0230.00415.91
7.3.100.0310.00015.90
7.3.90.0170.01216.30
7.3.80.0190.01315.98
7.3.70.0310.00616.11
7.3.60.0360.00516.17
7.3.50.0190.01316.11
7.3.40.0270.00616.07
7.3.30.0180.01216.18
7.3.20.0290.00816.12
7.3.10.0220.01315.98
7.3.00.0240.00716.12

preferences:
15.58 ms | 454 KiB | 5 Q