php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70960 ReflectionFunction for array_unique returns wrong number of parameters
Submitted: 2015-11-23 19:16 UTC Modified: -
From: ondrej at mirtes dot cz Assigned:
Status: Closed Package: Reflection related
PHP Version: Irrelevant OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 47 = ?
Subscribe to this entry?

 
 [2015-11-23 19:16 UTC] ondrej at mirtes dot cz
Description:
------------
ReflectionFunction::getParameters() for built-in function array_unique returns one parameter, although in practice the function accepts two parameters (and documentation states the same).

https://3v4l.org/Tj5cj

Test script:
---------------
<?php

$ref = new ReflectionFunction('array_unique');
var_dump(count($ref->getParameters())); // outputs "1" in the PHP runtime

Expected result:
----------------
int(2)

Actual result:
--------------
int(1)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-24 05:46 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e6b46dc2ff80e78a537155b6d5a556426c90fb59
Log: Fixed bug #70960 (ReflectionFunction for array_unique returns wrong number of parameters)
 [2015-11-24 05:46 UTC] laruence@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun May 09 07:01:23 2021 UTC