Skip to content

SimpleXML: soft-null xpath($expression) DEP + Invalid expression + false (#31530) - #31541

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-31530-simplexml-xpath-null
Aug 16, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-31530-simplexml-xpath-null

Conversation

@PurHur

@PurHur PurHur commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #31530

Test plan

  • ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_simplexml_xpath_null.php'
  • ./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/maintainer_gap_simplexml_xpath_null.php'
  • ./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php vendor/bin/phpunit test/compliance/SimplexmlXpathNullSoft31530VMTest.php test/compliance/SimplexmlXpathNullSoft31530JITTest.php'

Verification output

# VM
DEP:SimpleXMLElement::xpath(): Passing null to parameter #1 ($expression) of type string is deprecated
E2:SimpleXMLElement::xpath(): Invalid expression
false

# JIT
DEP:… / E2:… Invalid expression / false

# PHPUnit
OK (1 test) ×2 (VM + JIT)

php-src-strict; no new runtime/*.c.

Made with Cursor

…lse (#31530)

Match php-src sxe.c: coerce null under php-src-strict (deprecate), then warn and return false on empty/invalid expression instead of TypeError.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 81d2ec9 into master Aug 16, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-31530-simplexml-xpath-null branch August 16, 2026 19:46
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: SimpleXMLElement::xpath(null) TypeError — Zend Deprecated + Warning + false (ext/simplexml/sxe.c)

1 participant