|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50844 misbehaviour of zend_ts_hash_apply_with_arguments
Submitted: 2010-01-26 10:27 UTC Modified: 2021-08-22 04:48 UTC
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: Martin dot Eisengardt at fiducia dot de Assigned: krakjoe (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3.1 OS: Vista64-cygwin
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: Martin dot Eisengardt at fiducia dot de
New email:
PHP Version: OS:


 [2010-01-26 10:27 UTC] Martin dot Eisengardt at fiducia dot de
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-14 12:37 UTC]
-Package: Feature/Change Request +Package: Scripting Engine problem
 [2020-03-01 22:41 UTC]
-Assigned To: +Assigned To: krakjoe
 [2020-03-01 22:41 UTC]
It might be more sensible to drop TsHashTable instead.
 [2021-08-22 04:48 UTC]
-Status: Assigned +Status: Closed
 [2021-08-22 04:48 UTC]
No longer applicable, TsHashTable was dropped.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 17 08:03:36 2021 UTC