Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110981 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 97875 invoked from network); 13 Jul 2020 20:15:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Jul 2020 20:15:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BD908180538 for ; Mon, 13 Jul 2020 12:07:58 -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,HTML_MESSAGE,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from bonobo.elm.relay.mailchannels.net (bonobo.elm.relay.mailchannels.net [23.83.212.22]) (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, 13 Jul 2020 12:07:56 -0700 (PDT) X-Sender-Id: dreamhost|x-authsender|josh@joshbruce.dev Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 553DE7E19A1; Mon, 13 Jul 2020 19:07:55 +0000 (UTC) Received: from pdx1-sub0-mail-a1.g.dreamhost.com (100-96-19-25.trex.outbound.svc.cluster.local [100.96.19.25]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 7234F7E1A1A; Mon, 13 Jul 2020 19:07:54 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|josh@joshbruce.dev Received: from pdx1-sub0-mail-a1.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.8); Mon, 13 Jul 2020 19:07:55 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|josh@joshbruce.dev X-MailChannels-Auth-Id: dreamhost X-Reaction-Decisive: 27e232cb62c1da63_1594667274937_2578911171 X-MC-Loop-Signature: 1594667274937:3407103323 X-MC-Ingress-Time: 1594667274936 Received: from pdx1-sub0-mail-a1.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTP id 19224B3442; Mon, 13 Jul 2020 12:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=joshbruce.dev; h=from :message-id:content-type:mime-version:subject:date:in-reply-to :cc:to:references; s=joshbruce.dev; bh=uoHpyi1f0HM8qbQp6mlYrfg1T ng=; b=F+K5JGcJRyV6lr5dA1ZxZaVwQSzjpdFjFvyefTNGtS66QDbt13gaKzlmj 6D31zPZkwyxpbTQ/1KcWpiJ+nqSFB0pHak+66cFSNCjehbXEaI/a6WEkZvjlC7JQ ITmw4xiOKfe2FFMUltl/Jr5KAxOsZrOdsR9z4xlA5pKaZBoTGw= Received: from joshs-mbp.lan (21.140.29.136.in-addr.arpa [136.29.140.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: josh@joshbruce.dev) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTPSA id 91A80B3448; Mon, 13 Jul 2020 12:07:53 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a1 Message-ID: Content-Type: multipart/alternative; boundary="Apple-Mail=_4F89B7E4-24FF-4B2B-A7CD-A33156B238A1" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Mon, 13 Jul 2020 14:07:52 -0500 In-Reply-To: Cc: PHP Internals To: Gabriel Caruso References: X-Mailer: Apple Mail (2.3608.80.23.2.2) X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -51 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedrvdekgddufeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegoufhushhpvggtthffohhmrghinhculdegledmnecujfgurhephffktgggufffjgfvfhfosegrtdhmrehhtdejnecuhfhrohhmpeflohhshhcuuehruhgtvgcuoehjohhshhesjhhoshhhsghruhgtvgdruggvvheqnecuggftrfgrthhtvghrnhepudetjedtudduueehvdeludfhtdetkedvteejjedvjeeikedvtdegjeetheehvdefnecuffhomhgrihhnpehphhhpqdhfihhgrdhorhhgpdhphhhprdhnvghtpdefvheglhdrohhrghenucfkphepudefiedrvdelrddugedtrddvudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehjohhshhhsqdhmsghprdhlrghnpdhinhgvthepudefiedrvdelrddugedtrddvuddprhgvthhurhhnqdhprghthheplfhoshhhuceurhhutggvuceojhhoshhhsehjohhshhgsrhhutggvrdguvghvqedpmhgrihhlfhhrohhmpehjohhshhesjhhoshhhsghruhgtvgdruggvvhdpnhhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth Subject: Re: [PHP-DEV] Drop warning about non-public magic methods From: josh@joshbruce.dev (Josh Bruce) --Apple-Mail=_4F89B7E4-24FF-4B2B-A7CD-A33156B238A1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Curious. I tend to follow PSR-12 (with few exceptions): = https://www.php-fig.org/psr/psr-12/#44-methods-and-functions = Which requires visibility declaration on all members (methods and = properties).=20 Would dropping the requirement make the following impossible: class SomeClass { private function __toString() {} } $instance =3D new SomeClass(); $instance->__toString(); It=E2=80=99s one thing if PHP can always reach it, it=E2=80=99s a = different thing if I, as the developer, can make it so others can=E2=80=99= t. Cheers, Josh > On Jul 13, 2020, at 1:32 PM, Gabriel Caruso = wrote: >=20 > Hello internals, >=20 > During the development of = https://wiki.php.net/rfc/magic-methods-signature I > found something that I'd like to share with you, and possibly propose = to > drop it: there's a warning that php-src throws when a magic method is > declared with visibility different than `public`: = https://3v4l.org/LKnKB. >=20 > This warning does not make much sense as the magic method is executed > regardless of its visibility. Should it be dropped? >=20 >=20 > - Gabriel Caruso --Apple-Mail=_4F89B7E4-24FF-4B2B-A7CD-A33156B238A1--