mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
functions).
This commit is contained in:
parent
cea6a783af
commit
57510065ce
3 changed files with 25 additions and 2 deletions
2
NEWS
2
NEWS
|
@ -1,6 +1,8 @@
|
|||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? Nov 2005, PHP 5.1
|
||||
- Fixed bug #35022, #35019 (Regression in the behavior of key/current
|
||||
functions). (Ilia)
|
||||
- Fixed bug #35014 (array_product() always returns 0). (Ilia)
|
||||
|
||||
28 Oct 2005, PHP 5.1 Release Candidate 4
|
||||
|
|
|
@ -756,8 +756,8 @@ function_entry basic_functions[] = {
|
|||
PHP_FE(prev, first_arg_force_ref)
|
||||
PHP_FE(next, first_arg_force_ref)
|
||||
PHP_FE(reset, first_arg_force_ref)
|
||||
PHP_FE(current, NULL)
|
||||
PHP_FE(key, NULL)
|
||||
PHP_FE(current, all_args_prefer_ref)
|
||||
PHP_FE(key, all_args_prefer_ref)
|
||||
PHP_FE(min, NULL)
|
||||
PHP_FE(max, NULL)
|
||||
PHP_FE(in_array, NULL)
|
||||
|
|
21
ext/standard/tests/array/bug35022.phpt
Normal file
21
ext/standard/tests/array/bug35022.phpt
Normal file
|
@ -0,0 +1,21 @@
|
|||
--TEST--
|
||||
Bug #35022 (Regression in the behavior of key/current functions)
|
||||
--FILE--
|
||||
<?php
|
||||
$state = array("one" => 1, "two" => 2, "three" => 3);
|
||||
function foo( &$state ) {
|
||||
$contentDict = end( $state );
|
||||
for ( $contentDict = end( $state ); $contentDict !== false; $contentDict = prev( $state ) ) {
|
||||
echo key($state) . " => " . current($state) . "\n";
|
||||
}
|
||||
}
|
||||
foo($state);
|
||||
reset($state);
|
||||
var_dump( key($state), current($state) );
|
||||
?>
|
||||
--EXPECT--
|
||||
three => 3
|
||||
two => 2
|
||||
one => 1
|
||||
string(3) "one"
|
||||
int(1)
|
Loading…
Add table
Add a link
Reference in a new issue