Bug #79653 [NEW]: Unexpected error for ArrayIterator::ksort()
| From: | admad dot coder at gmail dot com | Date: | Sat, 30 May 2020 06:25:32 +0000 |
| Subject: | Bug #79653 [NEW]: Unexpected error for ArrayIterator::ksort() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-227238@lists.php.net to get a copy of this message | ||
From: admad dot coder at gmail dot com
Operating system: Linux
PHP version: master-Git-2020-05-30 (Git)
Package: SPL related
Bug Type: Bug
Bug description:Unexpected error for ArrayIterator::ksort()
Description:
------------
Using ArrayIterator::ksort() without any arguments generates
ArgumentCountError error.
Issue seems related to implementation of this feature request
https://bugs.php.net/bug.php?id=62840.
Test script:
---------------
<?php
$array = [];
$arrIter = new ArrayIterator($array);
$arrIter->ksort();
Expected result:
----------------
As per
https://github.com/php/php-src/blob/4fa3687e56050a111e8eaffe330258003628225e/ext/spl/spl_array.stub.php#L191
the new $sort_flags arguments has a default value. (In PHP 7 the method
does not have any arguments).
So I do not expect any error to be generated when calling the method
without any argument.
Actual result:
--------------
Above example code generate error like:
Fatal error: Uncaught ArgumentCountError: ArrayIterator::ksort() expects
exactly 1 parameter, 0 given
--
Edit bug report at https://bugs.php.net/bug.php?id=79653&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79653&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79653&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79653&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79653&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79653&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79653&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79653&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79653&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79653&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79653&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79653&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79653&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79653&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79653&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79653&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79653&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79653&r=mysqlcfg