Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117230 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 34702 invoked from network); 2 Mar 2022 22:27:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Mar 2022 22:27:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DCD981804E3 for ; Wed, 2 Mar 2022 15:49: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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (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, 2 Mar 2022 15:49:01 -0800 (PST) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-2db2add4516so37374887b3.1 for ; Wed, 02 Mar 2022 15:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M+RBAt2ldbQ4uK1tnvQDYYh2GceTuRVLz91WR1kjCLA=; b=ATE819eCMd3/edguFm+ZUUDgYM5GQgcGt4CxAzN0xHA3KHICuSr5KKg67t6q9z6Itq dCN3kIV4+V8ya82XXzg4LL7EmgC/abPWaECyjRfugaqbgsyoCSDJZaaHEK1HkKlMGMdL ofO3jS0ewWD7JUu4QH7JjMz2fQixIXoDvLJnK4tH9oZIcJkqyxDARUgIlY1pDdgyxvIs k/RFatZV2gawM1B73tCuBX7FW9xfRHdT4Eo2kTxcKsA82C/exg/oIDC7JXS+x1ynt94N PFyzUumr2LUos0CrwtTuzGAVS8/DqAopRtrZHJwFupiLqgeDwgL+fO8zXSgnuKcALmrX 4jTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M+RBAt2ldbQ4uK1tnvQDYYh2GceTuRVLz91WR1kjCLA=; b=zxeXit97XBKoe9fRTbDCw9nVpctyLLxuH5DP86Iveye8VDmq9P93BOTH6fLPWq5b3n 7zwiOdfvcxUvvAt3jEgfjMzxC5PSH9hFft/mHKhMwwacMxubOO4QkhixCDZEoTnSW6Ka uB/5Bj3Em832LmEGG2ioiv8OK6FozzaqkPDcp6ZEYotL0VraO05azdQFHU1+zq2q2l+a ctdDGae8I5ptg7zfEvE/DCoyBgxf/hAhQ8vQzIDXD8RaLtYmXbqevjqIJMUVvot9w5p3 BY/H2cEBaD7xQc+Z2jOhjqzmziR9XV9/5OyfnlNXjxRhnPgzPQ0zOPvmTDiqdAfskE73 eOJQ== X-Gm-Message-State: AOAM530FY24TOSCKgtdVGb39531W23Eyb+JH0sSE+JI02kPsoxYYC8oL UmmvVhJZiGy153m/uYKSQ/sogZ9MED9jeOiY4v4= X-Google-Smtp-Source: ABdhPJxeJFir+Sbq+1GfMDpIDmmyMDgplHgCjq89WXQE4ZZwQUajs/LmfZDOy11q4VDKEFDF59O+H1WEBgRVJK8Bf+w= X-Received: by 2002:a81:8d4a:0:b0:2ca:287c:6d3f with SMTP id w10-20020a818d4a000000b002ca287c6d3fmr32131652ywj.484.1646264940748; Wed, 02 Mar 2022 15:49:00 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 2 Mar 2022 15:48:49 -0800 Message-ID: To: =?UTF-8?Q?Tim_D=C3=BCsterhus=2C_WoltLab_GmbH?= Cc: tyson andre , "internals@lists.php.net" Content-Type: multipart/alternative; boundary="000000000000ffe4ea05d944ecd8" Subject: Re: [PHP-DEV] Adding `class UnsupportedOperationException extends RuntimeException` to php? From: jordan.ledoux@gmail.com (Jordan LeDoux) --000000000000ffe4ea05d944ecd8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 23, 2022 at 5:42 AM Tim D=C3=BCsterhus, WoltLab GmbH < duesterhus@woltlab.com> wrote: > Hi Tyson > > On 2/13/22 16:50, tyson andre wrote: > > Currently, there doesn't seem to be an exact fit for indicating that a > method isn't supported on an object by design (and will throw > unconditionally). > > (For example, when implementing an interface or overriding a base class= , > e.g. an Immutable datastructure not implementing offsetSet/offsetUnset, > > an object that does not support serialization and overrides > __serialize/__unserialize to forbid it, etc.) > > > > [=E2=80=A6] > > > > Thoughts on adding UnsupportedOperationException to the spl? > > > > The "Redacting parameters in back traces" RFC has the same issue for the > SensitiveParameterValue::__unserialize() method [1] which is not > supported by design. > > In userland I'd commonly use BadMethodCallException for this purpose, > but thinking about it: A `LogicException` is not really fitting for the > reasons you outlined. > > UnsupportedOperationException sounds like a useful addition to me. > > I like this idea, however I think something other than 'Operation' should be used. Perhaps it is due to all the work on my recent RFC, but to an 'Operation' implies an 'Operator'. -Jordan --000000000000ffe4ea05d944ecd8--