php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53470 other attribute does not exists
Submitted: 2010-12-04 01:06 UTC Modified: 2010-12-20 02:56 UTC
From: carlos@php.net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: carlos@php.net
New email:
PHP Version: OS:

 

 [2010-12-04 01:06 UTC] carlos@php.net
Description:
------------
---
From manual page: http://www.php.net/function.xml-set-end-namespace-decl-handler
---

Hi!

This function has the same problem that xml_start_namespace_decl_handler, the function does not expects $user_data. In the explanation appears:

HANDLING.
handler  ( resource $parser  , string $user_data  , string $prefix  )

the correct is:
handler  ( resource $parser  , string $prefix  )

and the below box of $user_data is not necessary.
----

I've looked the PHP source code of php-xml in xml.c file, and in line 1157 appears the following:

void _xml_endNamespaceDeclHandler(void *userData, const XML_Char *prefix)

but I think that "void *userData " in the php function refers to the $parser attribute, it seems me that is the start of confusion.

Regards :)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-20 02:56 UTC] kalle@php.net
-Status: Open +Status: Bogus
 [2010-12-20 02:56 UTC] kalle@php.net
Hi Carlos

The documentation (as of writing) is correct;

For xml_set_start_namespace_decl_handler(), which calls an internal function in xml.c (_xml_startNamespaceDeclHandler) that actually performs the call to the PHP userland function, you can see that we declare a zval *args[3] and pass 3 arguments that we are going to pass to the userland handler:

args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding);
args[2] = _xml_xmlchar_zval(uri, 0, parser->target_encoding);

0 = resource
1 = string (converted from XMLChar)
2 = string (converted from XMLChar)

Same is true for the xml_set_end_namespace_decl_handler() function except these arguments are passed instead:

args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding);

0 = resource
1 = string (converted from XMLChar)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 08:01:28 2024 UTC