Bug #62607 [Opn->Ana]: array_walk_recursive move internal pointer

From: Date: Thu, 19 Jul 2012 14:18:09 +0000
Subject: Bug #62607 [Opn->Ana]: array_walk_recursive move internal pointer
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-172083@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62607&edit=1 ID: 62607 Updated by: laruence@php.net Reported by: tito at miarroba dot net Summary: array_walk_recursive move internal pointer -Status: Open +Status: Analyzed Type: Bug Package: Arrays related PHP Version: 5.3.14 Block user comment: N Private report: N New Comment: it's a side affect of fixing #61730 before that fix, array_walk_ use a pos to hold iterator position, but that will cause segfault if the postion become a pending pointer(by unseting the array element). Previous Comments: ------------------------------------------------------------------------ [2012-07-19 10:27:12] reeze dot xia at gmail dot com Yes, it did after the fix for https://bugs.php.net/bug.php?id=61730. ------------------------------------------------------------------------ [2012-07-19 08:52:53] tito at miarroba dot net Description: ------------ array_walk_recursive move internal pointer position since 5.3.13 version Test script: --------------- $arr = array('a'=>'b'); echo 'Before -> '.current($arr).PHP_EOL; array_walk_recursive($arr, function(&$val){}); echo 'After -> '.current($arr); Expected result: ---------------- Before -> b After -> b Actual result: -------------- Before -> b After -> false ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62607&edit=1

« previous php.bugs (#172083) next »