[php-src] Issue #23447: segfault on soap server handler when it contains undefined constant
[email protected] (lmaltsis)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/23447
Author: lmaltsis
### Description
The following code:
```php
<?php
class foo { private $broken = undefinedConstant; }
$server = new SoapServer(null, array('uri' => ''));
$server->setClass('foo');
$server->handle(<<<'XML'
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body><anything/></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML);
```
Resulted in this output:
```
Segmentation fault (core dumped)
```
But I expected this output instead:
``undefined constant error``
### PHP Version
```plain
PHP 8.5.9 (cli) (built: Aug 7 2026 18:15:17) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.5.9, Copyright (c) Zend Technologies
with Zend OPcache v8.5.9, Copyright (c), by Zend Technologies
```
### Operating System
Ubuntu 24.04