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).
Version | System time (s) | User time (s) | Memory (MiB) |
---|---|---|---|
8.2.11 | 0.011 | 0.008 | 22.09 |
<?php
readonly class Name implements Stringable
{
public function __construct(
public string $value
) {
if (strlen($value) === 0) {
throw new ValueError("Name must be non-empty");
}
}
public function __toString(): string
{
return $this->value;
}
}
readonly class User
{
public function __construct(
public Name $name, // if we are receiving a Name instance, it just means that it's already a valid value!
) {
}
}
$user1 = new User(
new Name('Some valid name')
);
echo $user1->name; // "Some valid name"
$user2 = new User(
new Name('') // kaboom
);
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).
Version | System time (s) | User time (s) | Memory (MiB) |
---|---|---|---|
8.2.11 | 0.011 | 0.008 | 22.09 |