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
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 05 12:01:29 2024 UTC