Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109992 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96323 invoked from network); 4 May 2020 18:59:14 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 May 2020 18:59:14 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 09D49180548 for ; Mon, 4 May 2020 10:33:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 4 May 2020 10:33:56 -0700 (PDT) Received: by mail-wm1-f47.google.com with SMTP id r26so449221wmh.0 for ; Mon, 04 May 2020 10:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=j0J5YAmbqOrEL/fUilcdo5N4y1/uCYolgwH4ZNeRLvY=; b=ELcxVnDibh0Wqe+9TZ0Sxv7R8jB+pCik51vAzbjhZaJCfIBSq+LTa8mi99k4gLE7MQ NDZjaba0I3Ehow0/dV4JHtc0maCjJklkIi26voyibZvegU7O+KvSE30dJszfliOeW4iB sf8CR4VDY+Y91xbTVkbMq+GGMNq0HgF3TiI8c1+qfcYMKj1s6VvvfJ9Vltd8GQxziV7O dbTUQoorFZTUr+qaoScv2W0IuJR87zjijEmmDqz/yTRZIPWAfRLrlGKoS7Gok8nlzngh i4iWHMxOAKBkVWS2N8oLu9CAnTpWiLiHscQ4KmSZUPH/nUKY9OJwNlaJpbtX/YaQbCkA hIKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=j0J5YAmbqOrEL/fUilcdo5N4y1/uCYolgwH4ZNeRLvY=; b=h9n9l2hFLTBDgSKdHgjjwEp0kQ7mRshh3S4zByhxVg7Rttx6zCXy4eGP9L2vrw+X6U 6QRKDLpO30e9NcWFEpohIpjxaQ+HFeeaK8Rwuxu1IUSKJ4rt7NIIIXycfGo1+AVCyMLi uXNa69A/aDU3xF5bZR/qc8D9FQdvszw230/fNm+0rfCt77vZkxtUh2KNY8ihSr8Zx6zH cxElDNy8nPmbAAS+Zb8Xm3s6Teq/34X4Qr12O78/5ZuQBxGO1TzCVpL3Jk9OUfnKDgeJ 8G1vANYizOHsscsoD1zGSaehA9xLlVIlHvs2RJc/0iFnoP6TCzgPCw0z/u5VbhVMS3Uq kI0A== X-Gm-Message-State: AGi0PubhyOS2K5syf2MBmnYcGtEzRo3BLrLIa+vqKA5VE+wcITe2sdOf 0Qu6Em663v/NkK00ZRVNCbw9oeer X-Google-Smtp-Source: APiQypJJFiHlpqw4jH2ECUpsnI1QzCjY7SB2X20uGz9P3eQCDGxK/lzU0edE80TtwzgGSFk3fSFT2g== X-Received: by 2002:a1c:3dd6:: with SMTP id k205mr15868373wma.138.1588613632721; Mon, 04 May 2020 10:33:52 -0700 (PDT) Received: from [192.168.0.14] (cpc84253-brig22-2-0-cust114.3-3.cable.virginm.net. [81.108.141.115]) by smtp.googlemail.com with ESMTPSA id o6sm21404723wrw.63.2020.05.04.10.33.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2020 10:33:51 -0700 (PDT) To: internals@lists.php.net References: <171dee3baf3.bef5753260554.3262181919550021853@manuelcanga.dev> <171e05b4ced.1041f31b5124598.4028595156690203917@manuelcanga.dev> Message-ID: <10faa29f-f08f-a73e-b76d-683f5abbee86@gmail.com> Date: Mon, 4 May 2020 18:33:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <171e05b4ced.1041f31b5124598.4028595156690203917@manuelcanga.dev> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] Keep type of reference params From: rowan.collins@gmail.com (Rowan Tommins) On 04/05/2020 16:43, Manuel Canga wrote: > I think I’d be positive of adding `inout` keyword in order to: > > - Check type of out is equal to type of param( like example of my first email ). > - Avoid modifying caller var value when the function throws an exception Another huge advantage of adding inout parameters is that we could make it mandatory to mark at the call-site, and get the advantages of this RFC with less of the compatibility hassle of changing the way references work: https://wiki.php.net/rfc/explicit_send_by_ref We'd still need to figure out how to smoothly transition built-in functions to use inout rather than by-ref parameters; but then we already have magic "prefer-ref" in internal functions, so maybe we could come up with some kind of "prefer-inout". Regards, -- Rowan Tommins (né Collins) [IMSoP]