Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40348 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48863 invoked from network); 8 Sep 2008 16:58:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2008 16:58:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=esnafrao@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=esnafrao@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.169 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: esnafrao@gmail.com X-Host-Fingerprint: 66.249.92.169 ug-out-1314.google.com Received: from [66.249.92.169] ([66.249.92.169:18279] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/53-33249-EA955C84 for ; Mon, 08 Sep 2008 12:58:23 -0400 Received: by ug-out-1314.google.com with SMTP id s2so337689uge.37 for ; Mon, 08 Sep 2008 09:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=e+UigWVUS42mDf32yPSJEpXin58zFhLmBqm5Fcdann4=; b=bRor/CyDawscXzVWNg6GaB1X8EV3JO+9VlUvl2V5RBJtJOzpIlWp4zuJBJPHFtwmqh wy9W0P2ttzF0CamjrzTHhMe6gKXYTqD7VV0ecpbj4c+UqbBB6B7irq9mrtEl/SnRi50Y Waj8cQEfJLhxX1T0Ah6vxhMQCxvGP22aGQuZo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=ZkwI/SNVn2U5FfuwtleoYHlJaZtVEDV1V8pIvS5rws7+nBxQpsz+C77qrPtFIIOZax EQhcr4hiGRCmMTGdai4hswkKHlQWOJ9Qg++UctOXyvNPzMxTKprsaBm6ZHuWJ+YupAIr iGp00ugi7VVq5gIHm/9djZC9WaoKGJ/Ug3Kl8= Received: by 10.67.94.12 with SMTP id w12mr4234777ugl.25.1220893100013; Mon, 08 Sep 2008 09:58:20 -0700 (PDT) Received: by 10.66.238.3 with HTTP; Mon, 8 Sep 2008 09:58:19 -0700 (PDT) Message-ID: <2a149c8c0809080958j12ddbf84l2f0b533569d69557@mail.gmail.com> Date: Mon, 8 Sep 2008 18:58:19 +0200 To: "PHP Developers Mailing List" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2630_20469078.1220893100014" Subject: array and call_user_function From: esnafrao@gmail.com ("mr esnafrao") ------=_Part_2630_20469078.1220893100014 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I'm having problems passing an array to the function call_user_function as parameter. This is the code: zval *args[3], *func, *retval; MAKE_STD_ZVAL(func); MAKE_STD_ZVAL(retval); MAKE_STD_ZVAL(args[0]); MAKE_STD_ZVAL(args[1]); MAKE_STD_ZVAL(args[2]); ALLOC_HASHTABLE(args[2]); // creates hash and fills zend_hash_init(args[2], 0, NULL, NULL, 0); g_hash_table_iter_init (&iter, m->params); while (g_hash_table_iter_next (&iter, &key, &value)) { zend_hash_add(args[2], key, strlen(key), value, strlen(value), NULL); } ZVAL_STRING(args[0], estrdup(m->sender), 0); ZVAL_STRING(args[1], estrdup(m->cmd), 0); ZVAL_STRING(func, estrdup(handler), 0); if (call_user_function(EG(function_table), NULL, func, retval, 3, args TSRMLS_CC) == FAILURE) { g_debug("error calling method: %s", handler); } zval_dtor(retval); zval_dtor(func); zval_dtor(args[0]); zval_dtor(args[1]); zend_hash_destroy(args[2]); FREE_HASHTABLE(args[2]); I suppose that the problem is the conversion between the Hash and the zval, but I don't know how to do it. Thanks in advance :) regards ------=_Part_2630_20469078.1220893100014--