Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119208 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 67630 invoked from network); 24 Dec 2022 10:52:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 24 Dec 2022 10:52:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 678201804A9 for ; Sat, 24 Dec 2022 02:52:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: *** X-Spam-Status: No, score=3.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RCVD_IN_SBL_CSS,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 ; Sat, 24 Dec 2022 02:52:17 -0800 (PST) Received: by mail-wm1-f49.google.com with SMTP id ja17so5063161wmb.3 for ; Sat, 24 Dec 2022 02:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=zeU/eczQvLVjcfaLMsWYY4MAinq7WxhYWbnDEsczDl4=; b=UJ7l1K7VGRV/gF+oDkekx3RaIRaoStqXWdIEV9TLrfHl2BgbSUB1LjD7GUEc+JG3Yh eIPHJB9r4HWGHH1y4zUmnae3+B3dNRs+S2Fj84NMfXt74I6fSBQohno9Orrcx1/JP5dD PYECCNJ8XDjs02rYWe42bhhKDKlpgRxL/BkDaFHfLOvTF0PfSt5iR2SyqZ2dYbJrVgYA F9mwOiZ/KmDJ3BZMYa4w84Uuj/sT+v6yYuc+L6Vz9lnxPnlRTSyxo7sa/Os1yV4sAgEX wBOt4NXRmwliS19VSGjvFFwzVrgEzgZ4y6rBL6gIwbGhg0e82MuF8NejfSq3O5MDPZvU o66g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:to:from:date:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zeU/eczQvLVjcfaLMsWYY4MAinq7WxhYWbnDEsczDl4=; b=kg9xtZTJHP0wBzDFiRO+KZNw1BPBPw4ccb2wgvH6KrwY0YXIrWMPUx1NP1o5pbAV72 M4yA0LTCjibaj67/CWA6tbRfeSpyxEOn/6cFnudv9iuLbCkKF2yRIAlcWK0zvK6VGcEc +mBbn2cybpKotAg1hUXJMqMzZcgQFpwjsr3Q8058OYpGeUrV0f8QHxjoOeqwtddy655G 0YoJTW7iYPI8P8CEhiZKS9USKcYE0OgkovMwQD7s6ypsvv6oUfmsbL8dIWAp0BG3vgBW K6/4BXnMAMsIv+gqj/5xwnJCbFnqcC8e9F5LxhNqbLgiaEt3vPsFv5ILqQxIRy6lSdsQ kqlg== X-Gm-Message-State: AFqh2kqGmT1eBXSK3tGMBZTupiNCif2PoKAho8fkTIMcGWz1ihW0q6LU oRMFrCXOeJDbrsNZ8za/OCw4dgHmlTE= X-Google-Smtp-Source: AMrXdXtRi96SkSn+q86WTCa6DYqO0zPmmFCMOOmO8ZQZg4PC8XD8YAIZjU6pYQWbgxyHonqZ9P8deg== X-Received: by 2002:a05:600c:1c2a:b0:3d2:3376:6f2e with SMTP id j42-20020a05600c1c2a00b003d233766f2emr9336536wms.9.1671879136756; Sat, 24 Dec 2022 02:52:16 -0800 (PST) Received: from [127.0.0.1] (92.40.214.103.threembb.co.uk. [92.40.214.103]) by smtp.gmail.com with ESMTPSA id o15-20020a05600c4fcf00b003c6f3f6675bsm13360749wmq.26.2022.12.24.02.52.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Dec 2022 02:52:15 -0800 (PST) Date: Sat, 24 Dec 2022 10:52:13 +0000 To: internals@lists.php.net User-Agent: K-9 Mail for Android In-Reply-To: <2D4EE8E5-8BFA-40CB-953C-1E2355471E96@gmail.com> References: <2D4EE8E5-8BFA-40CB-953C-1E2355471E96@gmail.com> Message-ID: <70078A02-715C-4FA2-8B97-42DB3CA0AF94@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Methods which auto-return the class instance From: rowan.collins@gmail.com (Rowan Tommins) On 23 December 2022 13:29:07 GMT, Claude Pache = wrote: >> Yes but declaring `self` is more strict than `object`=2E=20 >> And talking about the word itself=2E=2E=2E Declaring to return (your-)`= self` but you could return someone-else of the same type as you=2E=20 >> But it is ok, it refers to the class name not the instance=2E just sema= ntic=2E >>=20 > > >It is not about being less or more restricted, it is about being plainly = ambiguous=2E Another big advantage of "return $this" is that it can't affect any existi= ng code=2E Granted, a function marked :self or :static which currently fail= s to return would be a runtime error, but changing that error into an impli= cit return $this could be very dangerous=2E Regards, --=20 Rowan Tommins [IMSoP]