Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129141 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 3F48E1A00BC for ; Fri, 7 Nov 2025 21:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762551077; bh=WCrS+TcuE3ezR4eCg7p866g5s9NkaV19OmKFlyIE5io=; h=Date:From:To:In-Reply-To:References:Subject:From; b=J7YT2uL/XPrd7oWk4T2LF2IKEJ4oEf/dE6Jv122JtIjHHvSulggNzz+HxpEvLi/9z PuYKTZowhXeDYYkeEmLiuOoqVlSnWEuOZACofd1r6D7RtVR7/FXj68NumRMdibKfBa Ha0jD6Bg9MLuwjsvNZTkuJzCGy2yKcgutT0tcjTYgIWNJRzn6og5fY1S0byp62y9dz FuTgBcOseh4PKkuJVBiDXYacuqhLETVlTzbZMIFz0r7LhNpKoa5sIoW5v2yiaq7nei dZb6QM0uinhZSjPnB7+kzMNBYlEFNahoJ9CFo/hey7ntMz4WWXQbQ3l/vcZ/Ie9BE4 gNndppaxwPUUQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D40D180083 for ; Fri, 7 Nov 2025 21:31:17 +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.9 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (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, 7 Nov 2025 21:31:16 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 28BDF1D0004C for ; Fri, 7 Nov 2025 16:31:11 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Fri, 07 Nov 2025 16:31:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1762551071; x=1762637471; bh=FwNBY9daVt17+qT1c5s1e k32KgzI6MpkwCZOGzNFJbM=; b=ZYmLi65IXxMjOkmjDqqW2yNb5lk0uT8D+33mo LkfZqMylPouMg5UnlmMp3vZ74yYhLGC/nqDrzNVLDX9M7u13msPaeu+agKBmwtLC IYT0yqUqWke137I2hIjAC8QueEKldmGOtR0iG0BYulxgqH2MaIhbMvFyI6MBxaW2 TTmcZyVsDCyhMY75F8XJU509YhKTonX6xH3ck0t0LqF8BsgxdOm25wEoVuyiyqu7 hYqonqfl7+pY3QV4wqrn1H6a0x0QC3IG83GamYcnTPUwFnF8C7tD03Yg1hex06JA f4aksXlp93GirOld8e82o2s0GotSyNr+dKneY5A57YJevzo3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1762551071; x=1762637471; bh=F wNBY9daVt17+qT1c5s1ek32KgzI6MpkwCZOGzNFJbM=; b=kNCyA4Pd45v7AicDf evD58rk0VNimMIU17xDgpgfmYaW42Ya9JlXjNPu3L7OC1+TVsXcAW2U/OuKpnIH2 mJ+e6iUk21hyi9KW5e6VVdIAkyBeqT5nAGB6h4t8tmGC2k2Twj8e+0JOBizBtclV MOWRv2pt8mWCosDnXocIPl0Gjf3nFtyi0JhbUs4oB7zEZI+hHkyc5sEPMyT+7gBC PTF2une4hD1RNtDr9EaMJ2ISvW4LwRhR1A6vBwuxW1VicAXtxAgjDVof/emAzvcL kk/+6qp0fJ49y9fLL4AuVedaKMeeSdJIhWpCG2hqX2dbSXv/ai90SgQmynX39tkP ueWTg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduledtjeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthejredtredttdenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpedugedvlefgueegheefjeetffduveeltefhfeegjeffffel gedttdevkeegkedugfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnhgspghrtghp thhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsh eslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A6625700065; Fri, 7 Nov 2025 16:31:10 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AW0xd6Hg98_- Date: Fri, 07 Nov 2025 15:30:49 -0600 To: "php internals" Message-ID: In-Reply-To: <467CA241-4457-4058-96D8-9CE721F22198@zort.net> References: <83BA9524-6095-4C8B-8F82-B2F344C4D062@zort.net> <611bb7bf-6cb1-4fa7-bab0-9d3bdc355989@app.fastmail.com> <467CA241-4457-4058-96D8-9CE721F22198@zort.net> Subject: Re: [PHP-DEV] Pre-RFC proposal: opt-in implicit interfaces / structural typing Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Fri, Nov 7, 2025, at 1:28 PM, John Bafford wrote: >> I could see implicit interfaces working in conjunction with extension functions, if we can figure those out. I'm not sure if they offer much value without them, given the state of PHP. It would basically mean you have to opt-out of a type rather than opt-in, as now. That could get... weird. >> >> --Larry Garfield > > Opting out would both be weird, and from a practical standpoint, is > unreasonable to ask of userspace developers. > > For correctness, every potential implicit interface match would have to > be explicitly declared as non-comforming in order to be correct. It's > both very noisy and does not scale. From a library perspective, it's > impossible: a library class can't possibly declare all the possible > does_not_implement conformances because the entire universe of > interfaces that might overlap its shape can't be known. OK, maybe opt-out wasn't the right term, since I agree marking "I do NOT implement interface X" is kinda ridiculous. :-) Implicit interfaces wouldn't really be opt-out, but they're more than the opt-in that we currently have. --Larry Garfield