Re: Segfault while looping through hash table

From: Date: Fri, 15 May 2009 08:03:00 +0000
Subject: Re: Segfault while looping through hash table
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-43972@lists.php.net to get a copy of this message
On 15.05.2009 07:31, Farley Knight wrote: > while (zend_hash_get_current_data(Z_ARRVAL(zhash), (void**)&value) > == SUCCESS) { > current++; > printf("Currently on entry %d\n", current); > if (zend_hash_move_forward(Z_ARRVAL(zhash)) == SUCCESS) > printf("Done moving hash forward. Result was successful\n"); > else > printf("Done moving hash forward. Result was a failure\n"); > } What's the point of this if() ? You continue reading the values even if move_forward() fails (i.e. the end is reached). -- Wbr, Antony Dovgal

« previous php.internals (#43972) next »