Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120559 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 88367 invoked from network); 12 Jun 2023 18:13:57 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jun 2023 18:13:57 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 375BC1804AC for ; Mon, 12 Jun 2023 11:13: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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 12 Jun 2023 11:13:56 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f70fc4682aso33486575e9.1 for ; Mon, 12 Jun 2023 11:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datadoghq.com; s=google; t=1686593635; x=1689185635; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XJS+k4yqS4DiU264AKekCWGnJ1lUE8Hq7/T9qlq6pMY=; b=TzSQgOAnT/k/5yMMeN7UEXIXN9vkiLySCpI0Onj/OHc+r9SvuGc8o5J+HzvjaYQ6RX j5cBTXC5BPUQXsc+LeGonuMUVFwn+lTpB9WYDwHQ8N7Jqq8foll6IkpavtZ/G4i7KocZ wgUGVX1QJf1eGHQai3XMEmQJaVxiv9wLhZmZc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686593635; x=1689185635; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XJS+k4yqS4DiU264AKekCWGnJ1lUE8Hq7/T9qlq6pMY=; b=G8V32Nrtd4eKdHR5MRwWBZ0NNb+AAoKFK8Vt893kSLZiy14MP75JJ1RboYexd2ylUK /4auyeqc17zDpWDUE9Tj/8O9vLBYhC/fPKA03YSddbhkWYpmT2BhlsYA4U5qx/O+Za84 yzXaj5fZxzRAuUyh3rLINb1yuL6J4mgVc+i0K+ZqEvnXE/wKl756qB0yFcA7vPetwUNG aJhbN0K1DFE0J9BCTu19Ei+yjC7PruDeodfEYizcGgNFRj8TryMza5qurSRQy0Ru7Tkq UwxERm4fnCPodoepsf3QVgDoqn8lS5VZjdIs27f134uHQMRYaikh2RdzCZZveZ09Rxix J3kA== X-Gm-Message-State: AC+VfDwNYSp8kiaQJZzg13+QLczxGIDoqSxpsxJ/42/ilT4pMm4fosje H7adyKIf+t0ITaLDheFrVinlSI1NHfxhxUEd4ohq4w== X-Google-Smtp-Source: ACHHUZ5ZvaDu2H9G72TmafCVEfY4mr4ZBADl5RFiCGI8iikUJ76INFyD6umfUiu4rfY5yh0GbxREEefwHRpWfHznL08= X-Received: by 2002:adf:f48b:0:b0:309:38af:91c6 with SMTP id l11-20020adff48b000000b0030938af91c6mr4661275wro.68.1686593635267; Mon, 12 Jun 2023 11:13:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: Levi Morrison Date: Mon, 12 Jun 2023 12:13:43 -0600 Message-ID: To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Cc: PHP Internals List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] [Discussion] Clone with From: internals@lists.php.net ("Levi Morrison via internals") On Mon, Apr 17, 2023 at 12:32=E2=80=AFAM M=C3=A1t=C3=A9 Kocsis wrote: > > Hi Everyone, > > Quite some time after mentioning the "clone with" construct the first tim= e > (at the end of the > https://wiki.php.net/rfc/write_once_properties#run-time_behaviour section= ), > finally I managed to create a working implementation for this feature whi= ch > would make it possible to properly modify readonly properties > while simplifying how we write "wither" methods: > https://wiki.php.net/rfc/clone_with > > Regards, > M=C3=A1t=C3=A9 Kocsis I apologize if this has been discussed before, as I have fallen very behind on internals discussions. I think it would be helpful to add an example where the object being cloned accesses its properties. Something like this: $b =3D clone $a with ["count" =3D> $a->count * 2]; If this is not valid, or if it has unexpected behavior or semantics, that should also be included in the RFC.