php.net |  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: zoe@php.net 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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zoe@php.net
New email:
PHP Version: OS:

 

 [2009-01-09 20:48 UTC] zoe@php.net
Description:
------------
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:
---------------
http://pastebin.ca/1304533

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

Expected result:
----------------
As shown in the test case above

Actual result:
--------------
array(0) {
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-09 21:54 UTC] felipe@php.net
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)
ZEND_END_ARG_INFO()

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-2019 The PHP Group
All rights reserved.
Last updated: Sat May 25 11:01:26 2019 UTC