Opened 8 years ago
Closed 8 years ago
#43903 closed defect (bug) (invalid)
Plug-in concatenation Error
| Reported by: | kaine78 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Editor | Version: | 4.9.5 |
| Severity: | normal | Keywords: | needs-testing |
| Cc: | Focuses: |
Description
In plugin-settings.php when a variable is concatenated in the format of:
<?php $x = "Hello " . $i+1;
the result evaluates to $x = "1".
Haven't done full testing but these results turn out fine:
<?php $x = $i+1."Hello"; $x = "Hello".1+$i;
Change History (1)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi @kaine78, welcome to WordPress Trac!
There's no
plugin-settings.phpfile in WordPress core. The observed behavior is the result of PHP type casting due to the dot operator having the same precedence as + and -. I don't see a WordPress bug here.