Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126225 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 359391A00BC for ; Sun, 26 Jan 2025 23:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1737932857; bh=3pFxpbHCfqpZOtVZRq6lcvCw6nji/RqA6fIT7+JB2t8=; h=References:In-Reply-To:From:Date:Subject:To:From; b=BOBHO/86BsxE47m3yS2bImNtO0YqpzaEdfOmCT1st2qaCAxRXA+5PNqs9JjbZ/mdi XS99wANTse/XVRzUydWLO+KgVX4YbX44NwKEzsDJkDvL931/bdFxgMTpPmX70Q4Kvp 709lzzfrHjk7qXIMK3PrsDWT++s+p5uo3mhfbTYremio+NO5QEC+X8NrB4CBy0gcCJ etSs2bUwINgp5R+9x8mvqEQ9HrcIg2xVtpe4B3o1epTlT2FWSCf1//sLObVeVqA6TB tasV0Rly4TgaYAYMQu+4JjxaU9xJFvWcj0X+aHAqoBFNbkmiOymFiqbXTAmedRaGpf lBpQfDkAa2JYw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 19DEA180061 for ; Sun, 26 Jan 2025 23:07:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 26 Jan 2025 23:07:36 +0000 (UTC) Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6dccccd429eso41326506d6.3 for ; Sun, 26 Jan 2025 15:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737933025; x=1738537825; darn=lists.php.net; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3pFxpbHCfqpZOtVZRq6lcvCw6nji/RqA6fIT7+JB2t8=; b=EFNvDiadRbX0H6NHXSeTIYfyNNkewwAv3KgKiGuvPJD0i2vuUQWu3pmkgokgk9WO9z vAOGyoOc3Ya9hbBsMVADDF0CPYog4Ne2kTImVyfij9QSXo3wnQjup6TeEUTFvGliUcbC cDXQVo8o4GZl7s2Z2nqQMBCKkUFe8R4bYrPG/g1MRQYFDfN/nzmjuDaL2RBTN+yKKR45 ER7abrWM1ouge98MxKR/87rE1Pl99ME+awdwnjUeJuT26LyPNKXCcuFXww18MPFszRRt 7jnbnE9iM2sZl1un3WV7xGaZSQc6kNAoFiRhqzJvA0eYeDqBeluIlAJ2fieBuuhgOJCS km3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737933025; x=1738537825; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3pFxpbHCfqpZOtVZRq6lcvCw6nji/RqA6fIT7+JB2t8=; b=rCVD29fc2Lee8yvxSHoU2MSJo182YZrcmExDdco0fb/OLb3r9aBaTpeXpsTvUZ4jxp qyqZU0qo3/cTPdGZ2ivyk81RFRTKOWIAuqrokOFyG/rnn+C+YhPPOZlT5t/ojXAA8FTq rDw5mJV6lcj93dsa4kV3Ne8n+REnNudX/Eg5IXR0L9fPj6A6VvKcmlN/6Eko9Zh5Otvs J19IPn5A5GFgOXvHE9cTGlMOeuUYgOhOzjWp5YRrngKphv3OcB2QmaRX5CtnkOiy4If0 zbUVToXr6i1xEqdaF09FPynmiXwPU7v+f/tPi2ZWGJO7aPjmFwgKv98q2GzIe/YSAq+B 0yAw== X-Gm-Message-State: AOJu0YxD/wXw54Cj1ttk5AUo14+6Omdgqzuty5GXcw/m+gxXD7RuaZeq MaMMhBVL1uAzDRvxVTmV7A+fB5Iu4SdbZEEDDcj5FKEFkx1IIJ14oezvchVOtZvnQfqFOkR5EkA jSw4/zC1oxn8nLOMEkImJWiQiWDr/aqdb+IXL9Q== X-Gm-Gg: ASbGnctP95qoKNLJbhcbck3KfHiBZOjl3bykw5uZeE1insVJmf7pLdE9OD/QUTavZ4j oIhRFGqVroX7kutTLzW+rbhzXBRgchjMcsCUaWgVosQKLXlxKSLqFymiqGYDundcSy42zr8vSTy mVC5/nI2KfInImM/GIU2qCZ9kH0NNv9Ho= X-Google-Smtp-Source: AGHT+IFTB7iAfnqET+kas7VPodvzvdCUbo5eZnbjYTv6oNGq1Ll4Nii0mZfVPgXaXH64XVKeYf9dTYcFFZTyf2hZFYw= X-Received: by 2002:a05:6214:5014:b0:6e1:a5c1:d534 with SMTP id 6a1803df08f44-6e1b226452dmr499154156d6.41.1737933024761; Sun, 26 Jan 2025 15:10:24 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 27 Jan 2025 00:10:13 +0100 X-Gm-Features: AWEUYZloqZoFu8jicvrHJvz-CrJLZB4mEap9ONcVvXCqAhyitds1v9sYBllzBUg Message-ID: Subject: Re: [PHP-DEV] Behaviour of ReflectionClass::getStaticPropertyValue() for uninitialized typed properties To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi Niels On Sun, Jan 26, 2025 at 7:43=E2=80=AFPM Niels Dossche wrote: > > I'm looking for feedback on a bugfix for https://github.com/php/php-src/i= ssues/12856. > Fix PR: https://github.com/php/php-src/pull/17590 > > So the alternative idea, the one implemented in my PR, would be this: > > - If the property is uninitialized, and $def_value is not provided, then = throw a ReflectionException with message "Property ... is not initialized a= nd no default was provided". > - If the property is uninitialized, and $def_value IS provided, then retu= rn $def_value. > - In all other cases, the behaviour stays the same as it was. I agree that this is the right approach. The proposed behavior is also in line with native property access, with or without ??. https://3v4l.org/S3mf8 Ilija