Closed ashatrov closed 7 years ago
Please add a test case that fails without this addition.
@prolic I have no idea how to simulate it.
Anyway, it is the correct way to get firsts key of Array, because the internal pointer can point beyond the end of the elements list.
http://php.net/manual/en/function.key.php
Return Values
The key() function simply returns the key of the array element that's currently being pointed to by the internal pointer. It does not move the pointer in any way. If the internal pointer points beyond the end of the elements list or the array is empty, key() returns NULL.
If we need to have the first key, it must be with reset(), because we cannot know where is pointer now.
e.g.
<?php
$arr = ['foo' => 1];
echo key($arr); // foo
next($arr);
echo key($arr); // Null
reset($arr);
echo key($arr); // foo
Maybe there is while(next($config)) { // do something }
somewhere in ZF.
Hi Guys waiting for this pr to be merged
@prolic What is the policy for releases? Will you create a minor release 2.6.3 with this changes to be able to use it in composer from packagist?
@ashatrov-propertyfinder done with https://github.com/ZF-Commons/zfc-rbac/releases/tag/v2.6.3
https://github.com/ZF-Commons/zfc-rbac/issues/373