[php-src] Issue #11091: Wrong argument order for TypeError message triggered with multiplication
| From: | DottedFont | Date: | Mon, 17 Apr 2023 10:12:45 +0000 |
| Subject: | [php-src] Issue #11091: Wrong argument order for TypeError message triggered with multiplication | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244215@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11091
Author: DottedFont
### Description
The following code:
```php
<?php
$var = "";
1 * $var;
```
Resulted in this output (shortend):
```
Fatal error: Uncaught TypeError: Unsupported operand types: string * int ...
```
But I expected this output instead (shortend):
```
Fatal error: Uncaught TypeError: Unsupported operand types: int * string ...
```
Happens when the second argument is stored in a variable or parameter before the operation.
Works correctly for other forms of arithmetic operators (+, -, /).
Inlining $var also produces the correct error message.
I ran it through every supported version on 3v4l and it was the same for all versions.
### PHP Version
PHP8.0.0+
### Operating System
_No response_