Doc #71412 [Opn]: Wrong parameters for ArrayIterator::__construct
| From: | pollita@php.net | Date: | Sun, 02 Jul 2017 14:44:07 +0000 |
| Subject: | Doc #71412 [Opn]: Wrong parameters for ArrayIterator::__construct | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14811@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71412&edit=1
ID: 71412
Updated by: pollita@php.net
Reported by: arjen at parse dot nl
Summary: Wrong parameters for ArrayIterator::__construct
Status: Open
Type: Documentation Problem
Package: SPL related
Operating System: Linux
PHP Version: 7.0.2
Block user comment: N
Private report: N
New Comment:
Closed by https://github.com/php/php-src/commit/96fe07e0062393d04188aa79f66979fc6bd4fee8
Previous Comments:
------------------------------------------------------------------------
[2016-01-19 10:00:57] arjen at parse dot nl
Description:
------------
https://3v4l.org/SlLdF#v702
http://php.net/manual/en/arrayiterator.construct.php
mentions two parameters: array and flags.
In 7.0.1 it has only array, since 7.0.2 it has array, ar_flags and iterator_class. Behaviour changed
by https://bugs.php.net/bug.php?id=71077
For ArrayObject is also reports ar_flags instead of flags.
Test script:
---------------
<?php
$rm = new ReflectionMethod('ArrayIterator', '__construct');
var_dump($rm->getParameters());
Expected result:
----------------
array(1) {
[0]=>
object(ReflectionParameter)#2 (1) {
["name"]=>
string(5) "array"
}
}
or
array(3) {
[0]=>
object(ReflectionParameter)#2 (1) {
["name"]=>
string(5) "array"
}
[1]=>
object(ReflectionParameter)#3 (1) {
["name"]=>
string(8) "flags"
}
}
Actual result:
--------------
array(3) {
[0]=>
object(ReflectionParameter)#2 (1) {
["name"]=>
string(5) "array"
}
[1]=>
object(ReflectionParameter)#3 (1) {
["name"]=>
string(8) "ar_flags"
}
[2]=>
object(ReflectionParameter)#4 (1) {
["name"]=>
string(14) "iterator_class"
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71412&edit=1