php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50546 zend_parse_method_parameters_ex does not honour flags for procedural parameter
Submitted: 2009-12-21 20:12 UTC Modified: 2009-12-22 09:09 UTC
From: hp at oeri dot ch Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.12 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hp at oeri dot ch
New email:
PHP Version: OS:

 

 [2009-12-21 20:12 UTC] hp at oeri dot ch
Description:
------------
zend_parse_method_parameters_ex can be called in a method or a plain function.

Flags are - however - only respected in the OOP context and ignored in a procedural context. Parameter parsing is therefore greatly limited.

Procedural context
Zend_API.c:1194 (svn head)
retval = zend_parse_va_args(num_args, type_spec, &va, **0** TSRMLS_CC);

OOP context
Zend_API.c:1213 (svn head)
retval = zend_parse_va_args(num_args, p, &va, **flags** TSRMLS_CC); 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-22 08:42 UTC] jani@php.net
Maybe there's reason it's named zend_parse_METHOD_parameters_ex(). No idea what you're reporting here -> bogus.
 [2009-12-22 09:09 UTC] hp at oeri dot ch
If you have a look at the function, it seems supposed to work in a PHP_FUNCTION which is called either a) on itself or b) as method of an object. It is used exactly like that numerous times, e.g. in the intl extension.

It distinguishes those two cases, and handles both gracefully.

HOWEVER, in one case (a) the flags given in the call are not forwarded to zend_parse_va_args. In the other case (b), it does.

Testing alternative argument definitions does work in both cases, but DOES issue void warnings.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Dec 01 07:00:01 2025 UTC