Req #50844 [Opn]: misbehaviour of zend_ts_hash_apply_with_arguments
Edit report at https://bugs.php.net/bug.php?id=50844&edit=1
ID: 50844
Updated by: cmb@php.net
Reported by: Martin dot Eisengardt at fiducia dot de
Summary: misbehaviour of zend_ts_hash_apply_with_arguments
Status: Open
Type: Feature/Change Request
Package: Scripting Engine problem
Operating System: Vista64-cygwin
PHP Version: 5.3.1
-Assigned To:
+Assigned To: krakjoe
Block user comment: N
Private report: N
New Comment:
It might be more sensible to drop TsHashTable instead.
Previous Comments:
------------------------------------------------------------------------
[2010-01-26 10:27:16] Martin dot Eisengardt at fiducia dot de
Description:
------------
I was using a TsHashTable in my extension and assumed that it behaves the same as normal HashTable.
It is almost the same except function zend_ts_hash_apply_with_arguments.
Reproduce code:
---------------
function applyFunc(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
int myint = va_arg(args, int);
// myint will contain the wrong integer. Hoever the following code will work
// va_list args2 = va_arg(args2, va_list);
// int myint = va_arg(args2, int);
}
zend_ts_hash_apply_with_arguments(ht TSRMLS_CC, applyFunc, 1, myInt);
Expected result:
----------------
Expected that there is no need to extract args2 before extracting the actual argument. In other
word: Expected to use the same applyFunc for both, TsHashTable and HashTable
Actual result:
--------------
You need to extract another va_list first before extracting the arguments
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=50844&edit=1
Thread (3 messages)