3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); abstract class User { public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; public function __construct(public string $email, public string $status = self::STATUS_ACTIVE) { } public function setStatus(string $status): void { assert( in_array($status, [self::STATUS_ACTIVE, self::STATUS_INACTIVE]), sprintf('Le status %s n\'est pas valide. Les status possibles sont : %s', $status, [self::STATUS_ACTIVE, self::STATUS_INACTIVE]) ); $this->status = $status; } public function getStatus(): string { return $this->status; } abstract public function getUsername(): string; } class Admin extends User { // Ajout d'un tableau de roles pour affiner les droits des administrateurs :) public function __construct(string $email, string $status = self::STATUS_ACTIVE, public array $roles = []) { parent::__construct($email, $status); } // ... public function getUsername(): string { return $this->email; } } class Player extends User { // Ajout d'un tableau de roles pour affiner les droits des administrateurs :) public function __construct(string $email, public string $username, string $status = self::STATUS_ACTIVE) { parent::__construct($email, $status); } // ... public function getUsername(): string { return $this->username; } }

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.4.20.0030.00618.88
8.4.10.0160.00017.78
8.3.150.0100.01016.60
8.3.140.0120.00818.50
8.3.130.0110.00217.79
8.3.120.0170.00717.68
8.3.110.0130.00317.93
8.3.100.0110.00825.21
8.3.90.0130.00422.62
8.3.80.0130.00617.48
8.3.70.0140.00816.57
8.3.60.0160.00416.98
8.3.50.0160.00516.89
8.3.40.0140.00717.75
8.3.30.0140.00417.63
8.3.20.0120.00521.62
8.3.10.0120.00422.02
8.3.00.0070.00721.47
8.2.260.0070.01116.45
8.2.250.0130.00416.37
8.2.240.0130.00617.11
8.2.230.0100.00519.00
8.2.220.0120.00318.88
8.2.210.0130.00319.91
8.2.200.0130.00317.15
8.2.190.0100.00716.34
8.2.180.0110.00819.55
8.2.170.0090.00918.44
8.2.160.0140.00319.21
8.2.150.0130.00521.31
8.2.140.0120.00521.76
8.2.130.0110.00621.81
8.2.120.0080.00720.10
8.2.110.0090.00620.12
8.2.100.0130.00419.55
8.2.90.0100.00520.09
8.2.80.0080.00520.09
8.2.70.0110.00339.63
8.2.60.0100.00525.17
8.2.50.0100.00423.30
8.2.40.0090.00524.70
8.2.30.0090.00524.74
8.2.20.0070.00422.17
8.2.10.0080.00424.25
8.2.00.0080.00523.67
8.1.310.0060.01218.38
8.1.300.0120.00316.13
8.1.290.0110.00520.98
8.1.280.0150.00419.34
8.1.270.0090.00521.90
8.1.260.0090.00522.29
8.1.250.0090.00422.87
8.1.240.0080.00519.91
8.1.230.0100.00520.21
8.1.220.0100.00520.01
8.1.210.0120.00319.79
8.1.200.0080.00728.13
8.1.190.0110.00426.82
8.1.180.0120.00326.16
8.1.170.0100.00526.11
8.1.160.0100.00526.08
8.1.150.0080.00423.30
8.1.140.0090.00423.96
8.1.130.0090.00524.10
8.1.120.0080.00523.89
8.1.110.0090.00423.46
8.1.100.0060.00623.07
8.1.90.0080.00422.37
8.1.80.0060.00622.44
8.1.70.0080.00521.37
8.1.60.0070.00622.19
8.1.50.0090.00522.19
8.1.40.0080.00521.90
8.1.30.0100.00520.97
8.1.20.0110.00521.05
8.1.10.0110.00521.14
8.1.00.0100.00520.83
8.0.300.0110.00420.47
8.0.290.0120.00427.41
8.0.280.0120.00425.71
8.0.270.0090.00423.72
8.0.260.0110.00622.18
8.0.250.0090.00423.62
8.0.240.0080.00522.92
8.0.230.0080.00622.44
8.0.220.0080.00622.47
8.0.210.0100.00522.43
8.0.200.0090.00522.47
8.0.190.0100.00422.03
8.0.180.0090.00422.34
8.0.170.0100.00421.18
8.0.160.0110.00320.63
8.0.150.0110.00420.55
8.0.140.0100.00520.53
8.0.130.0100.00420.34
8.0.120.0110.00420.20
8.0.110.0090.00520.11
8.0.100.0100.00419.90
8.0.90.0080.00519.65
8.0.80.0090.00519.96
8.0.70.0090.00519.96
8.0.60.0090.00519.90
8.0.50.0090.00519.86
8.0.30.0080.00519.73
8.0.20.0080.00519.96
8.0.10.0090.00519.15
8.0.00.0070.00520.15
7.4.330.0090.00421.13
7.4.320.0120.00521.61
7.4.300.0120.00421.30
7.4.290.0110.00621.70
7.4.280.0130.00420.18
7.4.270.0130.00620.10
7.4.260.0110.00519.63
7.4.250.0140.00419.77
7.4.240.0110.00519.80
7.4.230.0140.00319.54
7.4.220.0110.00419.26
7.4.210.0090.00519.46
7.4.200.0100.00619.48
7.4.190.0110.00419.53
7.4.180.0110.00419.54
7.4.160.0100.00619.38
7.4.150.0100.00519.38
7.4.140.0110.00519.37
7.4.130.0110.00519.33
7.4.120.0100.00619.27
7.4.110.0120.00419.28
7.4.100.0110.00419.36
7.4.90.0110.00519.27
7.4.80.0110.00419.29
7.4.70.0100.00519.25
7.4.60.0110.00519.29
7.4.50.0110.00519.24
7.4.40.0100.00419.21
7.4.30.0100.00519.23
7.4.20.0100.00419.27
7.4.10.0110.00419.27
7.4.00.0110.00319.28
7.3.330.0130.00521.47
7.3.320.0130.00519.81
7.3.310.0140.00319.62
7.3.300.0130.00419.37
7.3.290.0130.00419.37
7.3.280.0120.00619.30
7.3.270.0120.00519.23
7.3.260.0130.00419.19
7.3.250.0120.00519.20
7.3.240.0130.00519.24
7.3.230.0130.00519.24
7.3.220.0130.00419.18
7.3.210.0130.00519.20
7.3.200.0130.00519.15
7.3.190.0130.00519.17
7.3.180.0110.00519.19
7.3.170.0120.00419.23
7.3.160.0120.00419.17
7.3.150.0100.00619.15
7.3.140.0110.00519.16
7.3.130.0120.00419.15
7.3.120.0110.00419.28
7.3.110.0110.00519.16
7.3.100.0110.00619.28
7.3.90.0110.00519.36
7.3.80.0110.00519.19
7.3.70.0120.00419.25
7.3.60.0120.00419.25
7.3.50.0120.00419.27
7.3.40.0110.00519.27
7.3.30.0120.00519.26
7.3.20.0120.00520.44
7.3.10.0110.00420.38
7.3.00.0130.00420.44

preferences:
36.15 ms | 403 KiB | 5 Q