Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110131 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27121 invoked from network); 11 May 2020 12:18:03 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 May 2020 12:18:03 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9A7C91804DD for ; Mon, 11 May 2020 03:54:27 -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 ; Mon, 11 May 2020 03:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589194464; cv=none; d=zohomail.com; s=zohoarc; b=CA5hVoZyiqNza2b+vNnRv0EwWpzxMmb3BnRi800Ud8RoAZaImUsHHq/SGPMJkpStCnq9l4Ay3/zdScPeslDvkdKW0cXxWobL4G8V1X+RSpDDeoPY2Ol4FNXzPV36n19vlvMT8qCz1Y4ZdBnntXFn6CpCRAiVr+fN1UPtPMQdCMU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589194464; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=v23tFulsSRgRAKsUfy/nEiSu+YUWuj+9P6OSRHPLJls=; b=NqZlGMcCxwpDINGQAr+aqKAgPbOXCYBWubSd+gsGMrefBjl0LmIcrzLK3wAh4beAdXnqq8sqoYSTCofjV9OMRO/AVEJ/Jf/ui3LJ0erx5X4r5GW3z2QsvLJ03ocfdbY2TKfVj0YM/F6ificizbkepDcRgTVYC1DtdoWFNffvWok= 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=1589194464; 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=v23tFulsSRgRAKsUfy/nEiSu+YUWuj+9P6OSRHPLJls=; b=XE4Smf/ahLe7xl3f5atdyShN17QOL9Q035gPW9iWToG02RmdpCFNtArM8wcCgukv 3+vM5KNflZqidSgN0VFsvuJ3uIqdsm/w/v6B9SUXudwD+X3hnPSv4RI2AV2Rjy+2nxn uKEe0L40RagxSgwChqF5gbMcztqoCycNmnMPQdVg= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1589194431292960.8599815359557; Mon, 11 May 2020 03:53:51 -0700 (PDT) Date: Mon, 11 May 2020 12:53:51 +0200 To: "Nikita Popov" Cc: "Rowan Tommins" , "internals" Message-ID: <172035e5f2e.dac3608e708777.4548425207243262176@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, Nikita and internals, ---- En lun, 11 may 2020 11:34:22 +0200 Nikita Popov escribi=C3=B3 ---- > On Fri, May 8, 2020 at 8:49 AM Manuel Canga wrote = to this RFC, could someone give me(manuelcanga user ) karma in order to cre= ate wiki page ?. >=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 somet= hing. > As other's have mentioned, this is not a simple topic from the implement= ation side, so it's good to have a firm idea of how things would work on a = technical level. If you want to pursue the "inout" idea, I would recommend = reading through https://externals.io/message/101254 in its entirety, becaus= e there is quite a bit of inout related discussion in there. My current ass= essment 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 has impact on its behavior, e.g. the= fact that the reference will be initialized to null by default, even if th= e function throws.) > One of the core problems is that any naive approach to inout (i.e. liter= ally implementing it as a read before the call and a write after the call) = will necessitate a copy of the modified value, precluding rc=3D1 cow avoida= nce. Implementing array_push() as an inout operation would copy the array e= very time a value is pushed. Maybe this is actually a fundamental implement= ation-independent property of inout, if it has the semantics that the origi= nal value is not changed on exception (a copy would be necessary in case co= de later in the function throws.) Thanks, Nikita. I will read that thread.=20 I don't have know about PHP core so it's possible I will say a silly thing = but... is possible using Hack implementation ?. Maybe They found the best w= ay of implementation. Regards -- Manuel Canga