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; } abstract 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); } // ... } class QueuingPlayer extends Player { public function getUsername(): string { return $this->username; } } $Qp = new QueuingPlayer('roland@gras.ros', 'Roland'); var_dump($Qp);

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.3.140.0080.00018.50
8.3.130.0040.00418.63
8.3.120.0060.00318.82
8.3.110.0190.00617.90
8.3.100.0250.00318.88
8.3.90.0200.00619.88
8.3.80.0270.00816.34
8.3.70.0250.00816.54
8.3.60.0230.00816.49
8.3.50.0200.00616.54
8.3.40.0160.01117.71
8.3.30.0190.00417.82
8.3.20.0160.00819.66
8.3.10.0200.00519.58
8.3.00.0170.00619.42
8.2.250.0110.00718.49
8.2.240.0040.00417.28
8.2.230.0160.00818.46
8.2.220.0140.00823.46
8.2.210.0200.00619.77
8.2.200.0170.00516.61
8.2.190.0200.00616.51
8.2.180.0180.00718.78
8.2.170.0160.01117.85
8.2.160.0240.00518.89
8.2.150.0170.00619.34
8.2.140.0180.00819.31
8.2.130.0190.00519.73
8.2.120.0180.00318.55
8.2.110.0170.00619.21
8.2.100.0180.00518.23
8.2.90.0170.00618.17
8.2.80.0140.00618.29
8.2.70.0130.00530.24
8.2.60.0160.00318.06
8.2.50.0150.00518.11
8.2.40.0160.00618.41
8.2.30.0140.00718.16
8.2.20.0130.00918.00
8.2.10.0160.00518.09
8.2.00.0130.00618.47
8.1.300.0110.00420.25
8.1.290.0180.00317.02
8.1.280.0200.00618.61
8.1.270.0140.00719.52
8.1.260.0170.00519.92
8.1.250.0160.00620.39
8.1.240.0140.00818.38
8.1.230.0140.00918.23
8.1.220.0170.00717.91
8.1.210.0130.00718.49
8.1.200.0130.00817.83
8.1.190.0160.00417.78
8.1.180.0140.00617.81
8.1.170.0140.00517.93
8.1.160.0120.00718.22
8.1.150.0130.00718.64
8.1.140.0140.00617.88
8.1.130.0110.00817.82
8.1.120.0110.00617.99
8.1.110.0130.00517.82
8.1.100.0110.00717.79
8.1.90.0120.00517.74
8.1.80.0100.00617.80
8.1.70.0110.00617.69
8.1.60.0140.00517.85
8.1.50.0140.00617.89
8.1.40.0140.00618.03
8.1.30.0170.00518.09
8.1.20.0130.00518.13
8.1.10.0130.00517.89
8.1.00.0130.00417.86
8.0.300.0100.00617.58
8.0.290.0150.00417.11
8.0.280.0130.00517.36
8.0.270.0090.00617.43
8.0.260.0140.00417.18
8.0.250.0130.00617.41
8.0.240.0140.00417.38
8.0.230.0120.00517.36
8.0.220.0140.00517.19
8.0.210.0140.00617.15
8.0.200.0150.00417.20
8.0.190.0120.00717.27
8.0.180.0120.00617.21
8.0.170.0130.00617.24
8.0.160.0120.00517.25
8.0.150.0150.00417.16
8.0.140.0140.00417.34
8.0.130.0120.00516.49
8.0.120.0130.00717.33
8.0.110.0150.00317.34
8.0.100.0120.00617.37
8.0.90.0110.00517.13
8.0.80.0120.00717.35
8.0.70.0120.00617.34
8.0.60.0150.00617.31
8.0.50.0170.00417.28
8.0.30.0130.00517.27
8.0.20.0130.00517.40
8.0.10.0130.00517.34
8.0.00.0120.00518.04
7.4.330.0090.00715.55
7.4.320.0120.00616.85
7.4.300.0120.00616.87
7.4.290.0130.00616.82
7.4.280.0140.00516.84
7.4.270.0130.00516.86
7.4.260.0120.00516.84
7.4.250.0110.00716.84
7.4.240.0110.00516.79
7.4.230.0110.00616.86
7.4.220.0100.00716.79
7.4.210.0120.00517.10
7.4.200.0130.00517.00
7.4.190.0130.00516.99
7.4.180.0120.00516.88
7.4.160.0100.00516.82
7.4.150.0130.00416.81
7.4.140.0130.00416.74
7.4.130.0120.00516.70
7.4.120.0110.00516.64
7.4.110.0130.00416.62
7.4.100.0130.00517.10
7.4.90.0150.00616.75
7.4.80.0130.00716.67
7.4.70.0150.00616.75
7.4.60.0160.00516.68
7.4.50.0150.00616.59
7.4.40.0150.00416.63
7.4.30.0140.00416.61
7.4.20.0140.00616.66
7.4.10.0170.00416.64
7.4.00.0110.00616.72
7.3.330.0110.00616.70
7.3.320.0160.00516.33
7.3.310.0160.00516.68
7.3.300.0140.00416.72
7.3.290.0150.00616.60
7.3.280.0160.00416.53
7.3.270.0150.00416.63
7.3.260.0150.00516.61
7.3.250.0160.00416.60
7.3.240.0150.00516.60
7.3.230.0120.00616.66
7.3.220.0150.00516.64
7.3.210.0150.00416.59
7.3.200.0170.00416.57
7.3.190.0200.00316.59
7.3.180.0150.00616.55
7.3.170.0160.00416.61
7.3.160.0140.00516.59
7.3.150.0150.00616.60
7.3.140.0170.00516.59
7.3.130.0170.00516.54
7.3.120.0140.00716.56
7.3.110.0180.00416.60
7.3.100.0170.00616.50
7.3.90.0180.00416.76
7.3.80.0140.00516.60
7.3.70.0160.00516.59
7.3.60.0160.00416.71
7.3.50.0180.00416.64
7.3.40.0140.00616.70
7.3.30.0170.00416.63
7.3.20.0210.00417.69
7.3.10.0180.00517.68
7.3.00.0120.00517.74

preferences:
51.93 ms | 403 KiB | 5 Q