Category
stdlib
Problem
ext/xml procedural API (xml_parser_create, xml_parse, xml_parser_free, xml_parse_into_struct, …) is unimplemented. Apps using SAX-style parsing (RSS, legacy integrations) cannot run. Distinct from DOM (#3326) and SimpleXML (#3338).
Prerequisite (bootstrap): land #7406 skeleton first so function_exists('xml_parser_create') is true and factories throw catchable stubs — avoid duplicating registration work in this issue.
php-src reference
Repro (failure today)
<?php
$p = xml_parser_create();
xml_parse($p, '<root/>', true);
xml_parser_free($p);
echo "ok\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro.php
php bin/vm.php repro.php 2>&1 | head -3
'
| Step |
Zend (ext/xml) |
VM today |
function_exists('xml_parser_create') |
true |
false ❌ |
| Parse simple fragment |
ok |
undefined function fatal ❌ |
Phase-1 slice (after #7406 skeleton):
<?php
$vals = [];
$idx = [];
xml_parse_into_struct(xml_parser_create(), "<a><b/></a>", $vals, $idx);
var_export(array_key_exists('b', $idx));
Scope (this repo)
| Path |
Work |
ext/xml/ |
Real handlers (post-#7406 skeleton) |
| VM |
Parser resource type; incremental xml_parse; xml_error_string |
ext/xml/xml_parse_into_struct.php |
Phase 1b struct builder |
| Tests |
test/compliance/cases/stdlib/xml_parse*.phpt |
| Matrix |
script/capability-matrix.php |
PHP-in-PHP: parser state machine in ext/xml/*.php; expat via thin FFI if needed — not new logic in runtime/*.c. Libxml errors: #6058.
Done when
Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter xml_parse'
Related
Category
stdlibProblem
ext/xmlprocedural API (xml_parser_create,xml_parse,xml_parser_free,xml_parse_into_struct, …) is unimplemented. Apps using SAX-style parsing (RSS, legacy integrations) cannot run. Distinct from DOM (#3326) and SimpleXML (#3338).Prerequisite (bootstrap): land #7406 skeleton first so
function_exists('xml_parser_create')is true and factories throw catchable stubs — avoid duplicating registration work in this issue.php-src reference
ext/xml/xml.c— parser resource,xml_parse, optionsext/xml/xml.h— encoding constants (XML_OPTION_*)ext/xml/tests/*.phptRepro (failure today)
function_exists('xml_parser_create')truefalse❌okPhase-1 slice (after #7406 skeleton):
Scope (this repo)
ext/xml/xml_parse;xml_error_stringext/xml/xml_parse_into_struct.phptest/compliance/cases/stdlib/xml_parse*.phptscript/capability-matrix.phpPHP-in-PHP: parser state machine in
ext/xml/*.php; expat via thin FFI if needed — not new logic inruntime/*.c. Libxml errors: #6058.Done when
okon VM for create/parse/free cyclexml_parse_into_structrepro matches Zend index keys on harness./script/ci-fast.sh --filter xml_parsegreen (skip if expat absent — document)Verification
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter xml_parse'Related