Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110165 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49578 invoked from network); 15 May 2020 13:12:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 May 2020 13:12:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 42CA51804C8 for ; Fri, 15 May 2020 04:50:13 -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,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS2639 136.143.188.0/24 X-Spam-Virus: No X-Envelope-From: Received: from sender4-op-o11.zoho.com (sender4-op-o11.zoho.com [136.143.188.11]) (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 ; Fri, 15 May 2020 04:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589543407; cv=none; d=zohomail.com; s=zohoarc; b=euwaFS+RgDlyaZYWyhM5H94dDJ1FXq8gFY9bNsLCb9fANIQvfNA+nQBV6YzXPD0nRYlzD/vQY1ZfEMloHxqdywDXX91UifgHeNxGTLZazdkf2RhU8u7uNdJe2PDxTI2XWTupmEiOovy9s+tD7ylJ2nF1EVwBfKSWpkaEUhWD49A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589543407; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=5RwoE9w+0wMyuHi5TrsVOG2WNn3euBz1VxD00HGYPuY=; b=SuWoTsg1GDhT/+ShA1EQ6jBluhSikICXGhI+y5b4On7rPMJCiCGRv579LwrI3diFWMVcqiiTejFR4r5Y0/oXqUyzouR2GEnAiM72WMIEQi2zouf8OFV5OZBw2/6ucNps7TZAYjl2QxQ2Rh0czerI/0/ACl+THD9tydtsDSuurvM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=manuelcanga.dev; spf=pass smtp.mailfrom=php@manuelcanga.dev; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1589543407; s=zoho; d=manuelcanga.dev; i=php@manuelcanga.dev; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=5RwoE9w+0wMyuHi5TrsVOG2WNn3euBz1VxD00HGYPuY=; b=VtpDGow0CDSmAUQGKNVUAOmj7AgH8zL6msv1YdopR5vUJo12N7XYIRUlgRbDumsb 5E4VaaBw/8YiraIj/MkYCbkTwZCc/eWYWh+8zK7eTxBd14y0+A7E0Y+wd4zbcEcfJXR JLlZ2/QNtQT1U37G3fzyRQHERRhFGo919graEwy0= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1589543374200237.52213765956003; Fri, 15 May 2020 04:49:34 -0700 (PDT) Date: Fri, 15 May 2020 13:49:34 +0200 To: "Nikita Popov" Cc: "Rowan Tommins" , "internals" Message-ID: <172182ab93b.10cb04051144851.7293553067642036651@manuelcanga.dev> In-Reply-To: References: <171dee3baf3.bef5753260554.3262181919550021853@manuelcanga.dev> <171e05b4ced.1041f31b5124598.4028595156690203917@manuelcanga.dev> <10faa29f-f08f-a73e-b76d-683f5abbee86@gmail.com> <171f30b0df0.102b810be444185.2462173785894899100@manuelcanga.dev> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Subject: Re: [PHP-DEV] [RFC] Keep type of reference params From: php@manuelcanga.dev (Manuel Canga) Hi, Internals, ---- En lun, 11 may 2020 11:34:22 +0200 Nikita Popov escribi=C3=B3 ---- >=20 > I'm finding it hard to follow what is actually being proposed here at th= is > point (as many different ideas seems to be discussed at the same time). > I've granted you RFC karma on the wiki in case you want to write down > something. >=20 > As other's have mentioned, this is not a simple topic from the > implementation side, so it's good to have a firm idea of how things woul= d > work on a technical level. If you want to pursue the "inout" idea, I wou= ld > recommend reading through https://externals.io/message/101254 in its > entirety, because there is quite a bit of inout related discussion in > there. My current assessment is that I do not see any way to implement > inout in a way that both does not use references and has acceptable > performance. (Implementing inout on top of references is possible, but h= as > impact on its behavior, e.g. the fact that the reference will be > initialized to null by default, even if the function throws.) >=20 > One of the core problems is that any naive approach to inout (i.e. > literally implementing it as a read before the call and a write after th= e > call) will necessitate a copy of the modified value, precluding rc=3D1 c= ow > avoidance. Implementing array_push() as an inout operation would copy th= e > array every time a value is pushed. Maybe this is actually a fundamental > implementation-independent property of inout, if it has the semantics th= at > the original value is not changed on exception (a copy would be necessar= y > in case code later in the function throws.) >=20 > Regards, > Nikita =20 Nikita, I've already read your thread. I like your purpose about "Explicit = call-site send-by-ref syntax". I don't understand why it wasn't accepted.= =20 Yes, you're right about performance then maybe this RFC doesn't make much s= ense. :( Thanks, anyway. You can remove my karma again. Regards -- Manuel Canga