Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97194 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74450 invoked from network); 25 Nov 2016 23:32:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2016 23:32:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=jakub.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jakub.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.43 as permitted sender) X-PHP-List-Original-Sender: jakub.php@gmail.com X-Host-Fingerprint: 209.85.213.43 mail-vk0-f43.google.com Received: from [209.85.213.43] ([209.85.213.43:34556] helo=mail-vk0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B9/BC-21589-42AC8385 for ; Fri, 25 Nov 2016 18:32:53 -0500 Received: by mail-vk0-f43.google.com with SMTP id x186so48904598vkd.1 for ; Fri, 25 Nov 2016 15:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=aOzXs79RykzWu8kf3PIKh71RMrZv8ysLX6c+8UbRx8k=; b=isQaOaYFCmyfZ+Bq8dj0ruPOqAGEFWq/HB8HI4w3hG9Lks1N7mDj9GF0jNPpjJrM0C QTNVXw2HUz/tYcScrtcQXy0IPF25Cwo1dAgn3p2+DAdc6BvrEZxg6p/fBDnmbuUD2L3K oUGj9y/zGn5VKfVY/d/nRKhyZ9cT/1oHaQbIpEQRamkAc7Oht3StEHfHSMtjMQbeW2B8 ZGy8kldVB6kd/oxGjEzSoACsrA6o19g5OWapNY47hTY6IEiM3xjBVgPcPM8F9RPxLorl UxtgBf/VLCPQ4Ibdl272JAZRRpieg/5QlZIOYoNER6aTO8T4i8C8cPfZwduWxlvmlqGP HR1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=aOzXs79RykzWu8kf3PIKh71RMrZv8ysLX6c+8UbRx8k=; b=jH+hsHPERv3uFO7+41qAI19x0lRSVzsMH4WnewiaGrN5xTjc+Kn1M7c50OzLatcewr SewwDlwtO1RvN9iNjL2q2+Izol8aVYsDAh4aWMV+Qj8FuxCIhHaWFxaOLguztS6TdIU0 1JMr4qgtY/D4GSczwfLDTSHgB29syt2POwFw84mq1QZFvIirpyd4ZIgOK7WMx9SpY8ul FCwO5/aJcDgyYciLHypiGURKPIbP8sBbebWorUm5mMMkpvno/SJlBkpz2N84pgTCRPnK siDuBM2qOaiX1Kofw1gh+Y+7BQw5TpalUiF2V3boZeVlCgD7fS0VGO58qFLyXONKw+uJ iS/g== X-Gm-Message-State: AKaTC02kj63MV5JfTIazVXT8PeY7lQZJEL+OF7Ye223jPlu4XyESGwTifzW1VbQLM13nkgbursupxHrq4ot4zA== X-Received: by 10.31.222.1 with SMTP id v1mr3969732vkg.54.1480116769657; Fri, 25 Nov 2016 15:32:49 -0800 (PST) MIME-Version: 1.0 Sender: jakub.php@gmail.com Received: by 10.31.146.74 with HTTP; Fri, 25 Nov 2016 15:32:49 -0800 (PST) Received: by 10.31.146.74 with HTTP; Fri, 25 Nov 2016 15:32:49 -0800 (PST) In-Reply-To: References: <56e89e82-00aa-5521-f014-14cf4d588157@cubiclesoft.com> <5d865bc1-dc06-54b8-800e-99f1c2914632@cubiclesoft.com> Date: Fri, 25 Nov 2016 23:32:49 +0000 X-Google-Sender-Auth: X8xmDfLhrYvkCJIwKiWmrhUug8s Message-ID: To: Kalle Sommer Nielsen Cc: Thomas Hruska , PHP internals list Content-Type: multipart/alternative; boundary=94eb2c0cccc248180c0542288a53 Subject: Re: [PHP-DEV] Translating optional zval ** with zend_parse_parameters() to PHP 7 From: bukka@php.net (Jakub Zelenka) --94eb2c0cccc248180c0542288a53 Content-Type: text/plain; charset=UTF-8 On 25 Nov 2016 20:43, "Kalle Sommer Nielsen" wrote: 2016-11-25 13:30 GMT+01:00 Thomas Hruska : > I need to be able to *modify* the original variable that was passed in. I already use "|l" and zend_long > elsewhere in the extension Ah my bad I misread it! In that case take a look at where such is implemented in php-src, dns_get_record() is an example despite the slightly clouded code: http://git.php.net/?p=php-src.git;a=blob;f=ext/standard/dns.c;h= f92015eee90d3e93a801e93d6381d89923825166;hb=refs/heads/master#l1011 See $weight_list: - Check if the argument is passed - zval_dtor() - Populate it (ZVAL_LONG is the same) The main difference from your code is to use 'z' (lower case) in ZPP, and then use zval* (which is what 'z' returns). You also need set 1 for the first param of ZEND_ARG_INFO (specify that it is a ref param) otherwise it won't use the changed val... Jakub --94eb2c0cccc248180c0542288a53--