Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116849 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84747 invoked from network); 7 Jan 2022 17:48:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Jan 2022 17:48:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 68A311804C4 for ; Fri, 7 Jan 2022 10:56:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 ; Fri, 7 Jan 2022 10:56:47 -0800 (PST) Received: by mail-wr1-f45.google.com with SMTP id o3so12756726wrh.10 for ; Fri, 07 Jan 2022 10:56:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=d4Zi+3crnwIU6cP5vlnfK4rKQb5UreRuO0zbXlX5M2I=; b=JpKovPyNENkrMJsFG/ghen2DIl1MAzU+f4YSLDdSXana8+I63KYZfU/EMT+iYGoW5j XMi7L211eSNw3KisZk27kjBrFEY5FWDa4hThtXEfi6X/Hrt5fuC+6cdi0omdc05NVl+3 bs2f4SMVZvLbvvVlrtWDopuhRloaJFJRB3pKzzcq7GkvZo9/qn58GAQevERMLSH6WB0K cV1ioRn3DHZs/BCtGIiixiV/VvzKLrhnImHXZa+FPICwPpqsA0ZhEHihY8uq64hphryl HTH7d8Du2brMcOggJlBlc2SiBJuDWrY5M8aUegrm6ti8MXdzl6bkwvvKNtfaRb5JoQWD ugxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=d4Zi+3crnwIU6cP5vlnfK4rKQb5UreRuO0zbXlX5M2I=; b=l+gXyY1AHskA52030bI6IleMnCPn+e4YcdEEm5b5ypqQCZaUwFUpIjBvlxfYhXA8gX wLuxzNHqrQSIfqB6xLuJjXQm2AIvhbX8BaRr24JH40Dov36rvuePxiCDlIy1HsYh4UO7 HCnQ8cj1cZvh9nis5yKeS1GyOm2GEIeQorHUkJlFh6Xr/vWBT7MTckoO3CCM8PwdBocf bzBqN3r3nGWQWyc1NK05U7+RLk4Tv80QkPgesALdFNrKdBIn+gpS3lhoiADn8SUZ6Vt0 3wE8nN7ElHe3X+ykNjT/BDHKJFFXhXp4YMxbAh6OkrqbNRGEmFoC/8OUgDoSCjKdJ0ZE g1tw== X-Gm-Message-State: AOAM533PxCzSP8x30bcQKZqkTPWpMvf364WTqhHw077vLNaE3gsVA274 isSP3gzafut6oFi4SVU8s/5U+6CRQik= X-Google-Smtp-Source: ABdhPJwrwmo58GaXgyUsBm/74Fm97gjnSoE8AuUrH/cH1acDIQANE4h4a5qAEWDDi4U1FRqQe/9hvA== X-Received: by 2002:a5d:6c6a:: with SMTP id r10mr55259116wrz.60.1641581805796; Fri, 07 Jan 2022 10:56:45 -0800 (PST) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id m5sm4983458wml.48.2022.01.07.10.56.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jan 2022 10:56:45 -0800 (PST) Message-ID: <262352f2-a3e6-272d-1118-5455497217a7@gmail.com> Date: Fri, 7 Jan 2022 18:56:44 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Content-Language: en-GB To: internals@lists.php.net References: <1641335738.195767637@f174.i.mail.ru> <5a4aebf8-e592-4517-8930-d18b112ef1fd@www.fastmail.com> <5a99809d-afda-546c-5a11-a4f0f821aa37@korulczyk.pl> <6E50C348-9452-40E1-ACE8-06DED11C9136@gmail.com> <9070564d-e138-81f6-c757-812d8962416e@korulczyk.pl> <23f78a61-a73e-eaa3-861f-75e9bca28485@korulczyk.pl> In-Reply-To: <23f78a61-a73e-eaa3-861f-75e9bca28485@korulczyk.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC: Trait expects interface From: rowan.collins@gmail.com (Rowan Tommins) On 07/01/2022 13:47, Robert Korulczyk wrote: > I'm not really sure why would you not want this - what is the point of > marking method as interface implementation, if it is not reflected by > type system in actual execution? It's really quite simple: I don't want traits to tell me how I "must" use them, but am quite happy for them to document how I "can" use them. Unless we allow a trait to *automatically* implement the interface (or similar features, such as an interface with default implementation) there is no direct impact on the actual type system. There are, as far as I can see, three things the feature would provide: - Documentation: the trait can tell me as a programmer that it contains everything I need to implement a particular interface - Code generation: the trait can import the list of methods from an interface as abstract methods which it requires - Policing: the trait can force me as a programmer to use it in a certain way; this is the part I don't see the need for Regards, -- Rowan Tommins [IMSoP]