I'm having difficulty initialising an associative array in PHP with custom object values. For example:
public $basket = [
A => new Product("d", 2, 2)
]; // incorrect variant, interpretation error
public $basket = [
"A" => "B", "C" => "d"
]; // correct variant
How to resolve this problem?
__constructmethodassociable arraylooks weird enough to fit perfectly into PHP - I'm afraid it should read associative.)