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 __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.0.30.0100.00716.77
8.0.20.0030.01516.85
8.0.10.0060.01316.84
8.0.00.0180.00716.78
7.4.160.0060.00916.35
7.4.150.0070.01416.30
7.4.140.0040.01816.16
7.4.130.0200.00316.17
7.4.120.0160.00816.05
7.4.110.0120.01216.34
7.4.100.0150.01116.11
7.4.90.0220.00016.01
7.4.80.0150.01016.25
7.4.70.0110.01116.13
7.4.60.0180.01016.03
7.4.50.0210.00815.98
7.4.40.0120.01216.04
7.4.30.0280.00316.12
7.4.20.0150.00915.73
7.4.10.0230.00416.10
7.4.00.0190.01216.25
7.3.280.0130.01016.15
7.3.270.0150.01515.94
7.3.260.0170.00716.06
7.3.250.0130.01316.04
7.3.240.0130.01416.00
7.3.230.0140.01015.35
7.3.220.0140.00815.92
7.3.210.0160.01315.92
7.3.200.0250.00915.57
7.3.190.0230.00615.86
7.3.180.0230.00815.95
7.3.170.0220.00615.90
7.3.160.0180.01515.92
7.3.150.0210.01115.99
7.3.140.0100.01716.09
7.3.130.0160.01216.13
7.3.120.0120.00915.96
7.3.110.0140.01015.93
7.3.100.0140.01015.71
7.3.90.0190.01316.18
7.3.80.0180.01115.93
7.3.70.0230.00415.98
7.3.60.0250.00016.07
7.3.50.0160.00816.11
7.3.40.0190.00716.15
7.3.30.0130.01916.21
7.3.20.0190.00516.09
7.3.10.0230.00715.98
7.3.00.0110.01816.07

preferences:
142.09 ms | 1394 KiB | 7 Q