Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:131068 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 lists.php.net (Postfix) with ESMTPS id ED9B11A00BC for ; Fri, 29 May 2026 20:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1780085476; bh=rzEiuxq4nZk9rfMr16EPqwK4r6lwPe1+JnyY1WTpIZM=; h=From:Date:Subject:To:From; b=D4C2UiMMXRzq0j9Y28gILbnTM3PJUW5Jlv9QRaol72ghVQfLzl/ytYOFn47raF18I 342qLS3LHu0Gj3iinjPaA38TsNjPcZOH4EvKGcMvvE/kugrou2h9eVjnZrkxFN/GK8 J6V0OJbm8TsIdY6jMy3RynFgMdJeWuuO/el0NrAfAOtO15/qMyZ7Njppm9Z7mVMZ8H tc5dqqK+3hyAHUy6Q+ET6l4ufPWhLSzdSXC3oZMBJbn+YX140FxpRRJC4KWoh6yHGw zMK30/aL5MQanlBxp5fA6nNu1gKp6I+exQ7TMqAKME4DUYzKHZmmflHB1bmOb/EoZ0 7uaTfNteTQFXg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9F5BE18003F for ; Fri, 29 May 2026 20:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 ; Fri, 29 May 2026 20:11:15 +0000 (UTC) Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-8cce87d7995so12613366d6.0 for ; Fri, 29 May 2026 13:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780085469; cv=none; d=google.com; s=arc-20240605; b=CXGj9oSrRhhBR+s5dTuexYhLvCyzpvz8oWZ8FQr9lvpNrdDxt0eGNAJRGDz9sxDZ1k MqO7rJYAa1xUvGNXT5BgJvt7eA5rSYCuNRfbP6aXKX4STpMK1cz+8Du4JngXlqlt2zp5 p3wIG4l4k67pbHmYRSYDIZBFBrEwGTrXPr7peJYM2w6uvPBGzNUdrM5QI6rlveTzKyvJ 2JUU+7DZjRTGYYXkPrL2qimYilQ/nrogYHLukxxuM8HHygNfqZoV9+PWFvdHWM8ihM7i oCA6V1sV7jZr9/QeKw4JqlwYnYXaxL7ZPUZiU/IWVjRgy3EablrbeNSwJGy8v4lEwzTR uYhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=rzEiuxq4nZk9rfMr16EPqwK4r6lwPe1+JnyY1WTpIZM=; fh=RFBKMNwdsUBkXmmb8AAjYIg7L3EzMrZygiLbMB7seK8=; b=adjT9SQGBu0JfhgG/b3mNWw4XnowO8yg1bvyRvKPEbgS32dDNKn+05HJCdQMhWaTrk gr1K3pnoDM/hfZaoVC5C3p0Up7UYwYyWaBKHy9Heja9BI6Prfhy/P7ipfzTzRJxiVS1O gMebVOcVzWCSxxWsMi/45O+aCAaABgurbivWpryypWfQ+wpLcCeLwQ/pWcOC/5JeEfzA eQtUJZ6dMaFtHZyZhhmSD7xlRJbuIsF51gPvlYkn+wBjMBloKmhG43llwpwxBVN77Esj d4z3kerbjpqqZM20C2xBjxK6o7r2u9TuhnUZrotgQCUNSXLyhkRO2HPbXFDiDcvRhouw Cfvw==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780085469; x=1780690269; darn=lists.php.net; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=rzEiuxq4nZk9rfMr16EPqwK4r6lwPe1+JnyY1WTpIZM=; b=kOOYAo0F5PY0LmuLx3PGowTO73TOdwCGzi/T6yb1BwxZbnZ+9C5y8Zbmm6fFAVuBSe Xw6WGrR1FpyYfvk4IA6UqWEuitW7c+8kQOBL4W0GgLBd7vOXnHLqTHkQriNT4ISNk40F F3WdhAH95ah1dgLu/ZsLahiVyWZJYeTSSCdJMcyn0H3U2MhbAf8Ee6m2lWmLx5G0oMzb kwoN7b/mFC0RQy48ZPEJH/CHahh3OtGt4KugzTc3UgZCgCjdHU9Zl0jZYAkEkfrJMdwv 4TciBCEvYBOcywBBFsXHs7Rnk+rPcBc/CvifXHf7gbyUBPRlOn1QQyr0zM7CkZajhtvn vAmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780085469; x=1780690269; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rzEiuxq4nZk9rfMr16EPqwK4r6lwPe1+JnyY1WTpIZM=; b=MUaEoIdaFs158ca6xqZVkA8CfY73tRQm+GqrTdhYcVnFv378g9KLedpvHRzmlGY7Sc 2pMINbi9hu2fY0Iu2aTM3tleb+oYfHdDi9W9Zese+zzoHwQrNdNL8TozKlFAWADuJVV7 5DweTC0pln48uv656XZZs3F672AraobnrIN5Sp9brXP8HOtdArJixTSMD2Pbi/UgpsFN T0CRq/1gSNG0Fx54AXTMIBpj2A/PkawCILCzwrbUSik+xA4jDKiRl6g5TonnX00Eq/Qx V9ePkzInxB6KXx9/Q0cjNGMwpdobdnH5IzXHbaiM0t105WPopcfCO1nitxK27MRFz3GW yc6Q== X-Gm-Message-State: AOJu0Yzhp+fM1VPojTteGae98wnN85P//XBajSpUOmsXveQBkuDcDI+4 2ye0Y6h2vcOIgiYIyPT60TR9QYCnj087N/eUa1g5f8iR1ziGwFsLAQC3oStl99HVzNUdvjohSrr DXyssdukqF3Yb8jRSbXd1tPjr0iVFEGYL5gfvoc1KAw== X-Gm-Gg: Acq92OE/ikSXHoG3maEJbICh2m7mBEoif+Hk27JvrKvGTAOxqY+ebPsaGvUXN30Oh18 qbwB52Q9nOiByMrvyGcZpAI76Rq3vK9BAlzl8EN1cchlHQr5cIyEfp4D+GHeQ+ROIBWremUQ4QR /RjEDNt8nT0QTeuJdHpKfEelDIOwHHVnNQXCXQPWHLqA1B8FPEk3xgm9EPHdaagNKTfgcGmXHgT iHVhUrWTHwbRXrPEktzFLaGQc4vOKwsZOOorir17xj6WcQaErYAGzfJzMWPD+q+yHoZSp/3wQUs mvYP6fUgGiW5l4/BQ9J9ZX9YW9bFujnfJ85ASl9/NjW64BRSy3813CDTmDbK41LBwfGcFMI5IxA XZPIpNINXZO5bGmcPiljvtPZ2h9lEt9+8xWk5o/cfZ/YhmEX7z0B/Zd8q0DbTzieBWl+EUTMT3x O3AVccfLo/Ux9tQ2XIMrhK1hMHakK3vOIUs/Ra X-Received: by 2002:a05:6214:3d9b:b0:89c:4ea7:a70f with SMTP id 6a1803df08f44-8ccefb3b052mr20706516d6.14.1780085469452; Fri, 29 May 2026 13:11:09 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 29 May 2026 22:10:57 +0200 X-Gm-Features: AVHnY4KPqxw6Bmu9_vAYmOsiekYfzTvNXC0qTtzRj3cFbpjBBLqpnRjGUySjFcw Message-ID: Subject: [PHP-DEV] Proposed fix ??/empty and __isset materialization of properties To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000139e6e0652fa7279" From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --000000000000139e6e0652fa7279 Content-Type: text/plain; charset="UTF-8" Dear internals, Following the discussion around the __exists() RFC, PR #22181 [1] isolates the engine-only piece that was suggested there. The broader __exists() proposal remains on the table separately; this PR is scoped to just the sequencing issue. When `??` or `empty()` triggers `__isset()` on a magic property and `__isset()` writes into the property table (a pattern used in userland to lazily initialise a property), the engine currently calls `__get()` afterwards anyway. That redundant `__get()` is mostly cosmetic, but it can trip up patterns where `__get()` routes through a parent that doesn't know about the just-materialised property. The patch adds a property-table re-check after `__isset()` returns true: if the property now exists physically, the value is returned directly and `__get()` is skipped. `isset()` itself is unchanged (it has never called `__get()`). This sits between bug-fix and feature, so per the usual process: planning to merge to master in two weeks unless there are objections. The PR has already been reviewed by @iluuu1994 and @arnaud-lb. [1] https://github.com/php/php-src/pull/22181 [2] https://github.com/php/php-src/issues/12695 Cheers, Nicolas --000000000000139e6e0652fa7279 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear internals,

Following the discussion around the= __exists() RFC, PR #22181 [1]=C2=A0isolates the engine-only piece that was= suggested there. The broader __exists() proposal=C2=A0remains on the table= separately; this PR is scoped to=C2=A0just the sequencing issue.

Wh= en `??` or `empty()` triggers `__isset()` on a magic property and=C2=A0`__i= sset()` writes into the property table (a pattern used in userland=C2=A0to = lazily initialise a property), the engine currently calls `__get()`=C2=A0af= terwards anyway. That redundant `__get()` is mostly cosmetic, but it=C2=A0c= an trip up patterns where `__get()` routes through a parent that=C2=A0doesn= 't know about the just-materialised property.

The patch adds a p= roperty-table re-check after `__isset()` returns=C2=A0true: if the property= now exists physically, the value is returned=C2=A0directly and `__get()` i= s skipped. `isset()` itself is unchanged (it
has never called `__get()`)= .

This sits between bug-fix and feature, so per the usual process:= =C2=A0planning to merge to master in two weeks unless there are objections.=

The PR has already been reviewed by @iluuu1994 and @arnaud-lb.
<= br>[1] https://github= .com/php/php-src/pull/22181
[2] https://github.com/php/php-src/issues/12695

= Cheers,
Nicolas
--000000000000139e6e0652fa7279--