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.4.1 | 0.012 | 0.008 | 19.54 |
<?php
declare(strict_types=1);
interface HasId {
public string $id { get; set; }
}
class Foo implements HasId {
function __construct(
public string $id {
get => '#' . $this->id;
set (string $id) => $this->id = mb_strtoupper($id);
},
) {}
}
class Bar implements HasId {
function __construct(public string $id) {}
}
class Baz {
public function display(HasId $object): void
{
echo $object->id . PHP_EOL;
}
public function update(HasId $object, string $id): void{
$object->id = $id;
$this->display($object);
}
}
$foo = new Foo(id: 'FOO');
$bar = new Bar(id: 'BAR');
$baz = new Baz();
$baz->display($foo);
$baz->update($foo, 'foo');
$baz->display($bar);
$baz->update($bar, 'bar');
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.4.1 | 0.012 | 0.008 | 19.54 |