[php-src] PR #24137: ext/xmlwriter: report the right argument number for an invalid name in method calls
| From: | lacatoire | Date: | Mon, 05 Oct 2026 15:18:11 +0000 |
| Subject: | [php-src] PR #24137: ext/xmlwriter: report the right argument number for an invalid name in method calls | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39169@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24137
Author: lacatoire
XMLW_NAME_CHK hardcodes the procedural argument number, so the XMLWriter
method aliases report the wrong one:
```php
$w = new XMLWriter();
$w->openMemory();
$w->startElement('bad name');
// before: Argument #2 must be a valid element name, "bad name" given
// after: Argument #1 ($name) must be a valid element name, "bad name" given
```
The macro now shifts the number by one when the call has a $this. Procedural numbers
are unchanged. The new test covers the 16 affected methods and their procedural counterparts.