Easy
Is this code valid?
<?php
class Currency
{}
class Foo
{
private int $amount;
public function __construct(
public Currency $currency,
int $amount,
) {
$this->amount = $amount;
}
}
var_dump(new Foo(new Currency, 200));
Author: W3D TeamStatus: PublishedQuestion passed 1041 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
Similar QuestionsMore questions about PHP