PHP 8: Die neueste Major-Version ist da
Inhaltsverzeichnis

<code>#[ExampleAttribute]
class Foo
{
#[ExampleAttribute]
public const FOO = 'foo';
#[ExampleAttribute]
public $x;
#[ExampleAttribute]
public function foo(#[ExampleAttribute] $bar) { }
}
</code><code>class Money
{
public Currency $currency;
public int $amount;
public function __construct(
Currency $currency,
int $amount,
) {
$this->currency = $currency;
$this->amount = $amount;
}
}
</code><code>class Money
{
public function __construct(
public Currency $currency,
public int $amount,
) {}
}
</code><code>class Test {
public function createFromWhatever($whatever): static {
return new static($whatever);
}
}
</code><code>$object = new stdClass;
var_dump($object::class); // "stdClass"
</code><code>class Uri {
private function __construct(
?string $scheme,
?string $user,
?string $pass,
?string $host,
?int $port,
string $path,
?string $query,
?string $fragment // <-- ?
) {
...
}
}
</code><code>class Uri {
private function __construct(
?string $scheme,
?string $user,
?string $pass,
?string $host,
?int $port,
string $path,
?string $query,
?string $fragment, // <-- ?
) {
...
}
}
</code>Bereit für den Wechsel?
Wechsle jetzt zu cyon für ein souveräneres und nachhaltigeres Internet.
Beteilige dich an der Diskussion
8 Kommentare
Danilo
27. Jan. 2021Philipp Zeder
28. Jan. 2021CYON
Peter
9. Dez. 2020Philipp Zeder
10. Dez. 2020CYON
Peter
3. Dez. 2020Philipp Zeder
3. Dez. 2020CYON
Roro
3. Dez. 2020tobiv
3. Juli 2020