Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117484 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 9144 invoked from network); 6 Apr 2022 12:06:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Apr 2022 12:06:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 97017180545 for ; Wed, 6 Apr 2022 06:36:59 -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,FREEMAIL_FROM,HTML_MESSAGE, 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-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (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, 6 Apr 2022 06:36:59 -0700 (PDT) Received: by mail-yb1-f182.google.com with SMTP id g9so4027551ybj.9 for ; Wed, 06 Apr 2022 06:36:59 -0700 (PDT) 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=fFjfvohbmPeg2fS1guS1mx9H8VkbxlNR+u5tKCAST08=; b=Z+H05u0/pTBPZZi8ckoUs0HR3rFtNSROWmMkqxRH61Tzpkt+lEeddDOemRrwSKqP2O e0IW3f1my/UNp8oyldV/qYizdFPfWeZdzb1Yab19ojlt+uF3BMbcSrtm4lCSL57TZj7g 6KClqTN0tSJAvWakLIu05zWFiiBE57eypwSlzWDBsygl2ryUGqN5JRJuJGkgErIuFgID noJxMVoz0WYMbICqxfhC2OuqZI8lWergIwwY1aTy9dVuIHq/BvHgWNnwOLyFaGtoizOL fSawtvYJgCriNuJVIosLbyM7X65ku7qwlBQTG4poQUslJ2z4sJmI5d2NneuZMN354rY3 qtHQ== 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=fFjfvohbmPeg2fS1guS1mx9H8VkbxlNR+u5tKCAST08=; b=25fJsNJgMxEQ3GzoV5fHRmwwVnp+MLMbvzZRLVjvp/7sxjMyYCo0hromlRQUp//1qT ZKdHPveUX+3KGbMjtSi12WK2aHSUNgXbnB8yzAguHv3AuPY3Wt639o5aeYj+IcEosMaJ 16eexP2gf/V/GPMqcoBJtv/q2nddBbMdwiYP5NM+1nvb3Z4Jbdvea3LvFXVQujibKsry RLdymES7H34THAlb6eCpN6qyjtL0hlmluo4xNiX+VLWl1bcVBxIa7c2Fu/5BU2tM0Y1h 2naAkiUHdCwp6MEh2B02HkAQD6W379Ikjd3pBaHgE/st/RgRiRRM0zZa+v2LUxFuGogG QYSQ== X-Gm-Message-State: AOAM531HWjmXZH+owct+OXFF7uBBk129feDzy/QaCehCMwTDhDuJbUeU QRWhsxa3dIQ1558zGGGzoCvwkqQZEgwX5yklUg== X-Google-Smtp-Source: ABdhPJztW6MmPXL4iQipbFaVTR2uKfh5/QmC7+8WxAw6y1BS0xEJ1Yy1PmRRvygYYBb7MhflO48zunLFCmBq5KcF39g= X-Received: by 2002:a25:328a:0:b0:63c:7e3:c844 with SMTP id y132-20020a25328a000000b0063c07e3c844mr6295816yby.206.1649252218818; Wed, 06 Apr 2022 06:36:58 -0700 (PDT) MIME-Version: 1.0 References: <624d81b4.1c69fb81.eae57.b277SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: Date: Wed, 6 Apr 2022 15:36:47 +0200 Message-ID: To: Robert Landers Cc: internals Content-Type: multipart/alternative; boundary="000000000000a5d37305dbfc7438" Subject: Re: [PHP-DEV] [RFC] Undefined Property Error Promotion From: guilliam.xavier@gmail.com (Guilliam Xavier) --000000000000a5d37305dbfc7438 Content-Type: text/plain; charset="UTF-8" On Wed, Apr 6, 2022 at 2:37 PM Robert Landers wrote: > > FWIW, I'd like to see option 2 only because of custom serializers > and/or object proxies and also because: > > > This RFC proposes that accessing an undefined property is rendered > illegal behaviour > > StdClass has *no* defined properties and thus would always throw. But > I also guess it depends on what you define "undefined" as. Does simply > doing $obj->prop "define" the property "prop"? > The RFC doesn't change the current meaning of "undefined" (or "defined", or "declared"...), just proposes to throw an Error (while it currently triggers an E_WARNING). First sentence of the introduction: "Undefined properties are those that have not yet been defined either by the presence of a property declaration, or by adding them to the properties hashmap through direct assignment, or by having them assigned by an internal function such as json_decode." `$obj->prop` alone doesn't define the property "prop", but `$obj->prop = whatever` does. Regards, -- Guilliam Xavier --000000000000a5d37305dbfc7438--