Skip to content

Stdlib: xml_parser_set_option(null) E_WARNING string|int|bool (#30652) - #30752

Merged
PurHur merged 1 commit into
masterfrom
agent/ext-xml-30652-set-option-null
Aug 13, 2026
Merged

Stdlib: xml_parser_set_option(null) E_WARNING string|int|bool (#30652)#30752
PurHur merged 1 commit into
masterfrom
agent/ext-xml-30652-set-option-null

Conversation

@PurHur

@PurHur PurHur commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • xml_parser_set_option($parser, $option, null) now emits Zend 8.3+/8.4 E_WARNING (Argument #3 ($value) must be of type string|int|bool, null given) and still returns true / applies the option (ext/xml/xml.c PHP_FUNCTION(xml_parser_set_option)).
  • Non-string|int|bool values (float, array, …) take the same warning path. string|int|bool paths stay silent.
  • Withheld on the 8.4.0-dev reference / unset PHP_COMPILER_PROFILE so Zend 8.2 stays silent.

php-src: ext/xml/xml.c (zpp "Olz" then php_error_docref(E_WARNING, …) then zend_is_true / RETURN_TRUE). PHP implementation: ext/xml/xml_parser_set_option.php. No new C.

Closes #30652

Test plan

  • PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/issue_30652_xml_parser_set_option_null.php → Warning + true
  • PHP_COMPILER_PROFILE=8.2 php bin/vm.php test/repro/issue_30652_xml_parser_set_option_null.phptrue (silent)
  • php -d memory_limit=512M vendor/bin/phpunit --filter XmlParserSetOptionNull30652Test → OK 5/5
  • php -d memory_limit=512M vendor/bin/phpunit --filter 'XmlModuleSkeletonTest|XmlParserSetOptionNull30652Test|XmlErrorStringNull30651Test' → OK 18/18
  • php script/bootstrap-inventory.php --checkOK 7386/7386
  • AOT/JIT not in issue done-when (XmlFunction::call still VM-only)
  • make bootstrap-selfhost-link still running at PR time — stale gen-0 Zend fallback (Trust: refresh gen-0 spine sidecar — stamp ≠ spine SHA; link falls back to Zend (prelinked/bootstrap-gen0) #28998); this change does not touch spine/gen-0

Repro transcript (PROFILE=8.4)

PHP Warning:  xml_parser_set_option(): Argument #3 ($value) must be of type string|int|bool, null given in test/repro/issue_30652_xml_parser_set_option_null.php on line 5
true

Made with Cursor

php-src 8.3+ xml.c warns on a non-string|int|bool $value then still applies the option and returns true. Match that on PROFILE≥8.3; stay silent on the 8.2 reference profile.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 624605b into master Aug 13, 2026
0 of 2 checks passed
@PurHur
PurHur deleted the agent/ext-xml-30652-set-option-null branch August 13, 2026 12:20
@PurHur
PurHur restored the agent/ext-xml-30652-set-option-null branch August 13, 2026 12:32
@PurHur
PurHur deleted the agent/ext-xml-30652-set-option-null branch August 13, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: xml_parser_set_option(..., null) silent true — Zend E_WARNING string\|int\|bool (ext/xml/xml.c)

1 participant