Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130540 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 E9D491A00BC for ; Thu, 2 Apr 2026 20:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775160953; bh=iyVBDVZutcHS+hdJT8sIoDZUqd7m17cmaphAPVom+oY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aXhkicKVmqUh9mPF3/5hK7IEBY0yEIbOfmteJO4v40i4OIbqBqLPYNeNEAM/AxOtf vKRkiH+FqpcPzqB7k9pDc4efBu3iIb8P7y5A7HySFcUTHJWi6pW+rYYPMcYY4Bx4Qg 5Ctd3InNBu08S5VQ1WUgh4EP7K0wwtRn5AIoNtZTVEsT5XNjY53LWbPec12U7V+7vL O7oQHqIHt48Up1xCLTTl/9EpGIiGi0jnow1bt/wIduE38hk8TnwVGgFFl4L/+0qicI aFvVdsajYG9HCv3owJKNPr8BChBYvc711RjA7UWyEd4ZC1ml8JVMXLsZmqLNqFz0wX BksFhQdcsK2LQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 700B218007D for ; Thu, 2 Apr 2026 20:15:48 +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,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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 ; Thu, 2 Apr 2026 20:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1775160942; bh=GtM83glEi6NzUkvY5A+04Dj5iPSsl4TXI5dCLsEjGq4=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=W8U74pwxdCY8GUsRI3VVXrGNl/QGtUFPQKC3iZv5KdC/EwWw+v3wUOyYUA+pD3uJC HSZwa+lrxIYuLNP4JuK1buoqlF0RQXD/EENZV+wtRKppY1dhEAxI22Ot+LXdukW+2A XnaszLKZfcREhf/PDS5YOWo843dOiOCzrkLaWnONbQ/frYsjHvrf3Y8VAefxg4qavl arf8Qs3APiATCDWvx01CaqDEyUwI4taKd+/6tluH4HWDTMEc4VIYgLcotNL26HAf/Y +ov6eQut9D1D/NmfTnxjFllpITnMDZyYsWcfawyJgVVZsyMnOY8POjB8u1aySgnlMA dITX1EcrrQDzQ== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Thu, 02 Apr 2026 22:15:42 +0200 To: Jakub Zelenka Cc: Valentin Udaltsov , PHP internals list Subject: Re: [PHP-DEV] Re: [RFC] Polling API In-Reply-To: References: Message-ID: <126fb4b28fde5cb46753d22edd17ab01@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2026-03-31 15:23, schrieb Jakub Zelenka: > There is actually no internal API for hooks so it would require using > object handlers (which is from the user space point of view just > __get). It > means no stubs declaration either. We also don't have an internal > policy > where to use hooks and where methods. So there are still lots of > blockers > to start using it in core. While I agree with the conclusion that using hooks internally is complicated and there is no real policy there, Valentin was actually making a good point: We could use regular `readonly` properties for those cases where we're just exposing a “constructor parameter”. Specifically: - Context::getBackend() -> public readonly Backend $backend; - Watcher::getHandle() -> public readonly Handle $handle; Potentially Watcher::$data could also be a regular (non-readonly) property, or does `modifyData()` contain additional logic that is not just “store the value somewhere”? There is precedent for this kind of regular `readonly` property referring to an input object in ext/random with Randomizer::$engine: https://github.com/php/php-src/blob/32c1931f18109655bc074dd5cda3248b838de636/ext/random/random.stub.php#L139 Best regards Tim Düsterhus