Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108035 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60158 invoked from network); 8 Jan 2020 16:54:06 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Jan 2020 16:54:06 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E0BF31804D1 for ; Wed, 8 Jan 2020 06:59:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS42189 45.92.236.0/22 X-Spam-Virus: No X-Envelope-From: Received: from mail.noctuint.cz (mail.noctuint.cz [45.92.238.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 8 Jan 2020 06:59:32 -0800 (PST) Received: from mail.noctuint.cz (localhost [127.0.0.1]) by mail.noctuint.cz (Postfix) with ESMTP id 8432D60E551 for ; Wed, 8 Jan 2020 15:59:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=noctuint.cz; h=from:to :subject:date:message-id:mime-version:content-type; s=mail; bh=2 hVsUf0I41nxMaAlq6+s/OI+kLA=; b=L3C8OvV8Zwc2iarwMROGvb0+iBCSkPCEv nYB1XPcMzF12rQhw1gOJYAQRGDXboxqM+1X1yfl0ASldPnr2lt4Yuod++UnMtD8Q QOUvf6Lzt8+QpvnatPvota+LHVRdkIgysp2OsRAL6VG7mLi2wSJfzhPnJ2amHj1a Oa7vQAmt1g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=noctuint.cz; h=from:to :subject:date:message-id:mime-version:content-type; q=dns; s= mail; b=bq2D0Z/e3wOYxfKaHx//drSean9Iz4Vsl/eGBQ6HFkXefqThj8yNhMkR yAbd/sNnKd/ZJ7oeqRyVCjZTRxi0dz7ucZjPk8DWT4vTSiedtu+xM4zqfXfzjXm0 Bu9L6iw9/I/NY27AbgydXmvYIFc4PLSlXZu6tecGXJLveMhkq/4= Received: from nbmdolezal (unknown [82.142.101.30]) by mail.noctuint.cz (Postfix) with ESMTPSA id 603B560E550 for ; Wed, 8 Jan 2020 15:59:31 +0100 (CET) Reply-To: To: Date: Wed, 8 Jan 2020 15:59:28 +0100 Message-ID: <003401d5c634$3b617760$b2246620$@noctuint.cz> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0035_01D5C63C.9D265490" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdXGNDgWCaiaDvUqS/yPrm8BT4U6sA== Content-Language: cs Subject: zend_call_method with arguments passed by reference From: internals@lists.php.net ("mdolezal.noctuint.cz via internals") ------=_NextPart_000_0035_01D5C63C.9D265490 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, I hope this is the appropriate mailing list, please redirect me to better please if required. I am currently rewriting our PHP extension from PHP5 to PHP7. To call PHP methods from our C/C++ code we use slightly modified zend_call_method from Zend/zend_interfaces.c (to use more arguments than 2). Now I found out that it does not work with arguments passed by reference, such as: public function FuncWithRef(array &$changeThis) if values are changed in the PHP code then zval values back in C part after zend_call_function call are not influenced. With PHP5 the value was overwritten and could be used later in C code. Previously the zend_fcall_info struct for function call was filled with params simply by params[0] = &arg1; In PHP7 this is changed to ZVAL_COPY_VALUE(¶ms[0], arg1); After function is executed (zend_call_function) both fci.params and arg1 contain still the original zval values, changes made in PHP code are not available. Is there any way how to solve this? I am mainly searching for and comparing code snippets in PHP/ext folder to see how things were rewritten from PHP5 to PHP7. Sorry if I missed something obvious and thank you for your help. ------=_NextPart_000_0035_01D5C63C.9D265490--