Hi Mike
> $card_html = <<<HTML <div id="card-{$card->id}" class="card {$card?->css}">
> {$card->content} </div> HTML;
Two things:
1. We're solely talking about string interpolation without braces {}.
You're using braces in your example and this does indeed work right
now.
2. The semantics of ?-> are different than you're depicting them to be
in this example. ?-> will only short-circuit if $card is null, not
when the property "css" is not defined. Thus, if $card was null your
example would've already failed at $card->id.
Ilija
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php