Bug #74745 [NEW]: Incorrect ReflectionFunction information for array_multisort
| From: | tandre at themeetgroup dot com | Date: | Sun, 11 Jun 2017 20:10:48 +0000 |
| Subject: | Bug #74745 [NEW]: Incorrect ReflectionFunction information for array_multisort | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209484@lists.php.net to get a copy of this message | ||
From: tandre at themeetgroup dot com
Operating system:
PHP version: Irrelevant
Package: Arrays related
Bug Type: Bug
Bug description:Incorrect ReflectionFunction information for array_multisort
Description:
------------
ReflectionFunction incorrectly states that $sort_order and
$array1_sort_flags are passed by reference, not by value.
This doesn't make sense, and is inconsistent with the documentation at
https://secure.php.net/array_multisort
See https://3v4l.org/sZcuu
Test script:
---------------
<?php
$functionName = 'array_multisort';
printf("Params of %s:\n", $functionName);
foreach ((new ReflectionFunction($functionName))->getParameters() as
$param) {
printf("Param \$%s: isPassedByReference=%s, isOptional=%s,
isVariadic=%s\n",
$param->getName(),
var_export($param->isPassedByReference(), true),
var_export($param->isOptional(), true),
var_export($param->isVariadic(), true));
}
Expected result:
----------------
... otherwise unchanged
Param $sort_order: isPassedByReference=false, isOptional=true,
isVariadic=false
Param $sort_flags: isPassedByReference=false, isOptional=true,
isVariadic=false
... otherwise unchanged
Actual result:
--------------
Params of array_multisort:
Param $arr1: isPassedByReference=true, isOptional=false,
isVariadic=false
Param $sort_order: isPassedByReference=true, isOptional=true,
isVariadic=false
Param $sort_flags: isPassedByReference=true, isOptional=true,
isVariadic=false
Param $arr2: isPassedByReference=true, isOptional=true, isVariadic=true
--
Edit bug report at https://bugs.php.net/bug.php?id=74745&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74745&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74745&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74745&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74745&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74745&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74745&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74745&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74745&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74745&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74745&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74745&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74745&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74745&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74745&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74745&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74745&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74745&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74745&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74745&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74745&r=mysqlcfg