Opened 8 years ago
Closed 8 years ago
#43903 closed defect (bug) (invalid)
Plug-in concatenation Error
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.9.5 |
| Component: | Editor | Keywords: | needs-testing |
| Focuses: | Cc: |
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.
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.