Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112941 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99909 invoked from network); 20 Jan 2021 16:49:04 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jan 2021 16:49:04 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A9EA6180539 for ; Wed, 20 Jan 2021 08:29:04 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 20 Jan 2021 08:29:04 -0800 (PST) Received: by mail-io1-f49.google.com with SMTP id d13so44767083ioy.4 for ; Wed, 20 Jan 2021 08:29:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n0dsZYscUub29niGz68+CSNUExmrQfMQcadfwLTE0Mw=; b=WwHVMjZTXIgN/rcbyup91c0yZZNII0oz9AU+eL1PAsI5jpZe/Nx9WOeM0bU0rKY89K GCUJooiWoNd6gRgfe8qhi90M2v8iBdEAtjrnPeKTLOMwUgtnEIXDTLdolT9jOb4Kc1UU dMYkAS1SVTAPhfJjr3eiInpSxFZbs4m1ypGRDN0FJ8i8DdqvPSYyxSoMZrVnc9Zb8k5H aoqiz2ZdNSzbpIkqMKmeFdFJnHGg1qwASFTyPE1mfzBppQpHJlTtpsJKHfGFktSqGTKS J1fVno9z3RhbwPOeKK6D3VJhR3z+zsG6Xpig3rVV/jmc1qfDsvnUSYVZZRImVug8Vcza 7YrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n0dsZYscUub29niGz68+CSNUExmrQfMQcadfwLTE0Mw=; b=a+y37vYcH7nV1NhMPg8YaEmsws1ZPadUxvNuSL9dlZtjuYdfEAQsux01nnFOuagbNF 24yHzeqi2d2KkGxscIgP9WLb8/cARm5kmspYgvGy+mpfy8aEy0mzfsdSPTO1Na8ctiJn gk9VwhSHlY/qy8h/wQC4ye+i4ck+gIPYf2dUinj3QXdCbXML7DkO+NUyGi2W8+Glsc7L IzsY90KhQt7yUAc0TjHU88gd1WQbs8uA6fjzEjRH8G1uunvCOWriEEBkzDKS1PJgRQEX m72DbMN3DSYGeb6NRRzkUmd0WeSEzphu58se86pDrVlYTG3/5nWrRCl5wMyvA6fPuMPW ECQQ== X-Gm-Message-State: AOAM530HHUKkqk2VKyV1CRH6w+rvMYGIewfY6ndK5f5lyRA5UiWiJ45F nm5ccxDl/uqycEgloGKrxgH/178YzQId1OjyGTdhMd5yKl7HIdpk X-Google-Smtp-Source: ABdhPJw5nvh30zwfwHZ9mFDlGJ3r/sjP7xxdCoZkpFs5Ni/Wjkh2V2F98Qbm/Yv3RH6UARN5V3qkjMwOOdC3x6Awk6g= X-Received: by 2002:a6b:e805:: with SMTP id f5mr7155439ioh.111.1611160142032; Wed, 20 Jan 2021 08:29:02 -0800 (PST) MIME-Version: 1.0 References: <4C7634A2-885B-437B-B765-C82C2B93143B@benramsey.com> In-Reply-To: <4C7634A2-885B-437B-B765-C82C2B93143B@benramsey.com> Date: Wed, 20 Jan 2021 17:28:49 +0100 Message-ID: To: Ben Ramsey Cc: "internals@lists.php.net" , Dik Takken Content-Type: multipart/alternative; boundary="000000000000f1367105b9577308" Subject: Re: [PHP-DEV] __repr() magic method (was Re: Proposal: short_var_export($value, bool $return=false, int $flags=0)) From: ocramius@gmail.com (Marco Pivetta) --000000000000f1367105b9577308 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 20, 2021 at 5:27 PM Ben Ramsey wrote: > Taking this to a new thread so I don=E2=80=99t derail the `short_var_expo= rt()` > thread. > > Dik, I like this addition, but I think the name =E2=80=9Crepr=E2=80=9D mi= ght be confusing > to PHP developers who aren=E2=80=99t familiar with Python idioms. PHP fun= ction > names and coding standards within the community tend to lean more toward > verbosity than terseness, when it comes to naming things. > > Perhaps we should follow the lead of `__toString()` and use > `__toRepresentation()`? Maybe also introduce a `Representable` interface, > like `Stringable`? https://wiki.php.net/rfc/stringable > Ooof, can we just avoid more magic methods overall? :| Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --000000000000f1367105b9577308--