Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97192 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64517 invoked from network); 25 Nov 2016 20:43:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2016 20:43:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.195 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.223.195 mail-io0-f195.google.com Received: from [209.85.223.195] ([209.85.223.195:33300] helo=mail-io0-f195.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/7B-21589-A52A8385 for ; Fri, 25 Nov 2016 15:43:06 -0500 Received: by mail-io0-f195.google.com with SMTP id j92so11514553ioi.0 for ; Fri, 25 Nov 2016 12:43:06 -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=UVTQAZ8DfTLLqh79NN+jawJDntFhmV12UOFJNZ+sVoI=; b=EDRiiFixbZfw8X5WYZRhVMO+nl5y+JSqUBu/kigkzRpGaORra5c/jw6sUobdqPlQGM fOxloFns30iHh2l+qiQyrUp9z9E/3j8gbvkvry+BVlkRG57nN2OrA+5Dym3rASfshAg8 RAz3/DbkD07o2p0NdWresI7+DsotgbituFf3YWJoTJu1ogA53s4iUka8gDYRxGckdz8/ oX2LsRj01RP/ceJ4+eh9qH2/nFnzJyrKvTv+dndtQGINVehK/6Mie01yvgZue26VWv++ ++CAHYj9NDgoH5UM4PMDjyxUdodsKpq7gMXYdvGZUsg8/GSa2MB/M4PpheuzKEKtJAYz uqbw== 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=UVTQAZ8DfTLLqh79NN+jawJDntFhmV12UOFJNZ+sVoI=; b=Qgi+vVmBNVob2uDsH43hPNYQS6yp8+PLTPF370z5Pe8IdbDL7+9YLZ3i73IfDV5GVg /9+IshRERSS7/j6AWby4HuLj83EWraFk/IjaaOq74rmRT8RfkTvoO703mnp/hUX0lUC+ IBjUAeLGsDg7SijGZNL74De/EH7lqpvHvxs91jjiv/q6p4rV3p5+syZ+4PLf+VhU5JmD 29dXzqFpbB1ump+h48LqgZRv1S8Vnfysz88J2/lx+riAhMOmWDvBUleQWUAFLKa6QrZ/ +FaM9UwLD++JbEroATJZ+tLf5pjxJUNj1U+HeYDECoIWjSisFbvurUljnZ4yo4SeIqRl aiUA== X-Gm-Message-State: AKaTC02A6ih3QEbBpROpVOyz95Agjh6Mncw5V/NU6+HXCpI1V78cJS92HXoNPSbZbtxvnvtl+4v6KQTctCuczg== X-Received: by 10.36.131.138 with SMTP id d132mr8679114ite.98.1480106583021; Fri, 25 Nov 2016 12:43:03 -0800 (PST) MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.107.138.234 with HTTP; Fri, 25 Nov 2016 12:43:02 -0800 (PST) In-Reply-To: <5d865bc1-dc06-54b8-800e-99f1c2914632@cubiclesoft.com> References: <56e89e82-00aa-5521-f014-14cf4d588157@cubiclesoft.com> <5d865bc1-dc06-54b8-800e-99f1c2914632@cubiclesoft.com> Date: Fri, 25 Nov 2016 21:43:02 +0100 X-Google-Sender-Auth: f-Ia0Mmug7nDsZEn83QlD5QtEVo Message-ID: To: Thomas Hruska Cc: PHP Development Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Translating optional zval ** with zend_parse_parameters() to PHP 7 From: kalle@php.net (Kalle Sommer Nielsen) 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). I'm not at my dev machine, so I cannot test it but that should be how it goes -- regards, Kalle Sommer Nielsen kalle@php.net