[php-src] Issue #15711: SoapClient can't convert BackedEnum to scalar value
| From: | MrMeshok | Date: | Mon, 02 Sep 2024 11:03:45 +0000 |
| Subject: | [php-src] Issue #15711: SoapClient can't convert BackedEnum to scalar value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247677@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/15711
Author: MrMeshok
### Description
The following code:
```php
<?php
enum TestBackedEnum: string
{
case First = 'first';
}
$client = new SoapClient('https://raw.githubusercontent.com/php/php-src/master/ext/soap/tests/classmap.wsdl');
$book = new stdClass();
$book->a = TestBackedEnum::First;
$book->b = '';
$client->dotest($book);
```
Resulted in this output:
```
PHP Fatal error: Uncaught Error: Object of class TestBackedEnum could not be converted to string
```
But I expected this output instead:
```
No errors
```
### PHP Version
PHP 8.3.11
### Operating System
_No response_