[php-src] Issue #13229: Strange string concatenation issue after upgrading to PHP 8.3
| From: | janforth | Date: | Tue, 23 Jan 2024 17:04:00 +0000 |
| Subject: | [php-src] Issue #13229: Strange string concatenation issue after upgrading to PHP 8.3 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246323@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13229
Author: janforth
### Description
In PHP 8.2 this line worked perfectly well:
$togetherWithName = "gemeinsam mit " . (($receiver[0] ===
($article?->getCoAuthor() ?? "none") || $receiver[0] ===
($article?->getCoAuthor()?->getEmail() ?? "none" ) || $coautor) ||
$emailContext->isForCoAuthorOnly()) ? ($article?->getAuthor()?->getFullName() ??
"N.N.") : ($article?->getCoAuthor()?->getFullName() ?? "N.N.");
After upgrading to PHP 8.3 the string concatenation did not work anymore. The first part of string
"gemeinsam mit " (engl.: 'together with') was always left out for whatever
reason. The string $togetherWithName always only contained the name of the respective author from
the right party of the string concatenation.
This could fix the issue:
```
$togetherWithName = (($receiver[0] === ($article?->getCoAuthor() ?? "none")
|| $receiver[0] === ($article?->getCoAuthor()?->getEmail() ?? "none" ) || $coautor)
|| $emailContext->isForCoAuthorOnly()) ? ($article?->getAuthor()?->getFullName() ??
"N.N.") : ($article?->getCoAuthor()?->getFullName() ?? "N.N.");
$togetherWithName = "gemeinsam mit " . $togetherWithName;
```
But I think the one-liner should work.
Thanks!
### PHP Version
PHP 8.3
### Operating System
Debian 12