3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); namespace App\Entity; class Email { private string $email; private ?string $domain; public function __construct(string $email) { $this->email = $email; $this->setDomainFromEmail($email); } public function getEmail(): string { return $this->email; } public function getDomain(): ?string { return $this->domain; } public function __toString(): string { return $this->email; } private function setDomainFromEmail(string $email): void { preg_match('/^.+@(.*)/', $email, $matches); $this->domain = $matches[1] ?? null; } } #[ORM\Entity] class User { public function __construct( #[ORM\Column] private string|Stringable $firstName, #[ORM\Column] private string|Stringable $lastName, #[ORM\Column] private string|Stringable|Email $email, #[ORM\Column] private null|string|Stringable $cuid = null, #[ORM\Column] private ?int $id = null, ) {} public function getId(): ?int { return $this->id; } public function getFirstName(): string|Stringable { return $this->firstName; } public function getLastName(): string|Stringable { return $this->lastName; } public function getEmail(): Email|string|Stringable { return $this->email; } public function getCuid(): null|string|Stringable { return $this->cuid; } public function __toString(): string { return "$this->firstName $this->lastName"; } }

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.5.10.0100.00916.49
8.5.00.0100.01019.70
8.4.150.0010.00114.05
8.4.140.0150.00817.40
8.4.130.0020.00617.77
8.4.120.0120.00823.98
8.4.110.0110.00918.82
8.4.100.0150.00717.57
8.4.90.0050.00317.48
8.4.80.0110.00719.34
8.4.70.0120.00917.52
8.4.60.0140.00717.66
8.4.50.0080.00818.71
8.4.40.0060.01317.60
8.4.30.0070.01020.36
8.4.20.0180.00417.74
8.4.10.0040.00419.35
8.3.280.0020.00114.05
8.3.270.0130.00616.51
8.3.260.0120.00716.52
8.3.250.0110.00920.64
8.3.240.0110.00916.57
8.3.230.0060.00616.50
8.3.220.0120.00816.49
8.3.210.0100.00816.80
8.3.200.0140.00616.56
8.3.190.0090.00918.25
8.3.180.0050.00317.18
8.3.170.0040.01318.85
8.3.160.0070.00318.14
8.3.150.0110.00717.27
8.3.140.0070.01117.06
8.3.130.0080.00018.29
8.3.120.0060.00318.90
8.3.110.0070.00320.94
8.3.100.0070.00424.06
8.3.90.0040.00426.77
8.3.80.0060.00316.50
8.3.70.0100.01016.88
8.3.60.0210.00018.38
8.3.50.0110.00824.41
8.3.40.0140.00321.90
8.3.30.0110.00418.54
8.3.20.0060.00324.18
8.3.10.0050.00224.66
8.3.00.0000.00726.16
8.2.290.0090.01018.77
8.2.280.0090.01116.65
8.2.270.0130.00617.35
8.2.260.0090.00616.56
8.2.250.0030.00618.36
8.2.240.0040.00416.69
8.2.230.0070.00722.58
8.2.220.0090.00037.54
8.2.210.0080.00026.77
8.2.200.0090.00016.38
8.2.190.0110.00716.58
8.2.180.0070.00725.92
8.2.170.0040.01118.96
8.2.160.0140.00022.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0070.00026.35
8.2.110.0060.00320.39
8.2.100.0030.00620.35
8.1.330.0120.00716.09
8.1.320.0070.01216.11
8.1.310.0100.00718.13
8.1.300.0030.01319.66
8.1.290.0060.00330.84
8.1.280.0040.01125.92
8.1.270.0040.00423.99
8.1.260.0050.00328.09
8.1.250.0090.00028.09
8.1.240.0060.00318.82
8.1.230.0100.00018.49
7.4.120.0200.01116.25
7.4.110.0260.00416.34
7.4.100.0160.01616.37
7.4.90.0220.01216.28
7.4.80.0230.00816.42
7.4.70.0180.01216.38
7.4.60.0200.01016.43
7.4.50.0200.01016.46
7.4.40.0170.01216.54
7.4.30.0210.00816.36
7.4.20.0090.01916.26
7.4.10.0290.00016.07
7.4.00.0060.01316.37
7.3.240.0140.00616.12
7.3.230.0270.00916.07
7.3.220.0220.01116.18
7.3.210.0290.00316.32
7.3.200.0240.00616.41
7.3.190.0290.00616.20
7.3.180.0240.01216.29
7.3.170.0200.01016.35
7.3.160.0290.00316.22
7.3.150.0230.00816.18
7.3.140.0250.00816.23
7.3.130.0290.00716.41
7.3.120.0200.01016.20
7.3.110.0210.01416.37
7.3.100.0230.00716.03
7.3.90.0240.00716.05
7.3.80.0250.00516.25
7.3.70.0240.00516.13
7.3.60.0300.00916.22
7.3.50.0250.00616.21
7.3.40.0140.01916.04
7.3.30.0220.00816.08
7.3.20.0230.00816.08
7.3.10.0280.00516.27
7.3.00.0260.01016.33
7.2.340.0210.01716.48
7.2.330.0230.00816.18
7.2.320.0230.01316.32
7.2.310.0230.00916.42
7.2.300.0170.01016.27
7.2.290.0160.01216.47
7.2.280.0280.00716.29
7.2.270.0180.01416.49
7.2.260.0270.00716.32
7.2.250.0260.00916.45
7.2.240.0180.01216.38
7.2.230.0180.01216.29
7.2.220.0200.01016.25
7.2.210.0210.00816.28
7.2.200.0200.01016.16
7.2.190.0200.01216.38
7.2.180.0200.01016.40
7.2.170.0200.01016.17
7.2.160.0150.01816.31
7.2.150.0270.00616.28
7.2.140.0310.00316.36
7.2.130.0190.01216.21
7.2.120.0290.01516.45
7.2.110.0240.01116.36
7.2.100.0370.00816.37
7.2.90.0330.00716.35
7.2.80.0310.01216.62
7.2.70.0270.01016.45
7.2.60.0280.01116.43
7.2.50.0240.01316.27
7.2.40.0250.00816.64
7.2.30.0290.00816.43
7.2.20.0270.00716.28
7.2.10.0320.00716.34
7.2.00.0230.00916.38

preferences:
30.01 ms | 403 KiB | 5 Q