|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47058 ReflectionFunction::getParameters() retuns null
Submitted: 2009-01-09 20:48 UTC Modified: 2009-01-09 21:54 UTC
From: Assigned:
Status: Not a bug Package: Reflection related
PHP Version: 5.2.8 OS: Linux and Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2009-01-09 20:48 UTC]
ReflectionFunction::getParameters() returns an empty array for some (not all) functions which have parameters.

This feature works correctly in PHP53, as far as I can tell the code to make it work was added on 11/08/2008 by cseiler, there is no bug reference in the CVS comment so I don't think this is a duplicate, apologies if there is and I have failed to find it.

Reproduce code:

Note: PHP needs to be built with zlib to run this.

Expected result:
As shown in the test case above

Actual result:
array(0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-09 21:54 UTC]
Hi Zoe, this is expected. As of 5.3 we have added all missing arginfo for all ext/*, then we have:

ZEND_BEGIN_ARG_INFO_EX(arginfo_gzopen, 0, 0, 2)
	ZEND_ARG_INFO(0, filename)
	ZEND_ARG_INFO(0, mode)
	ZEND_ARG_INFO(0, use_include_path)

That helps reflection to know about the param name, number of parameters, if the param(s) is/are by ref.

Prior 5.3, few extensions did make use of the arginfo (the ZEND_BEGIN_ARG_INFO_EX stuff).
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 21:01:27 2024 UTC