Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99786 invoked from network); 3 Aug 2018 19:26:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2018 19:26:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=levim@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.167.47 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.167.47 mail-lf1-f47.google.com Received: from [209.85.167.47] ([209.85.167.47:36692] helo=mail-lf1-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 37/1F-59628-F5CA46B5 for ; Fri, 03 Aug 2018 15:26:24 -0400 Received: by mail-lf1-f47.google.com with SMTP id b22-v6so4867629lfa.3 for ; Fri, 03 Aug 2018 12:26:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=P8YRJoiv5M2lPVWRHZz5sNJUW5flfUZ0fB13HZsxEEc=; b=R3IAtHz4Yt7zgSQjKz/DJA8R5yJzK3SrclT5/y0a5tjGWHAX9XlOfZaAXZY7XA3pBS CfggOesV0h3Q32uo80YmhYwgyg8gbQ54bXRhefTU8fxWB44s2GBB3CFOs9TOtDamRalM HIqzcMu254BVvGtp8vYm0AeUgQ+G4g8mc6nomaDtidGV0LT83Y7cLKM2opbrY8VK29kf VRuDDKYK53pVfLTmjb/kpsIG37P1QG9F5qgOvWl0LbfGUTneT22ffCGgqdbmfTRjbfUG u8YzeiHTollCRRvQxn4QFBnsWeJ11xjLlDP4dM1P5TAcmwYKtPbELgv9LxLvQG9Rm8v+ fLkg== X-Gm-Message-State: AOUpUlHe+kzldhJmAAz33T58nAaAKJSFIXM3zzz9QAHqFDGGV95Rz63+ MDsILUjcSRbjq6IQuB7IZgNf9wtOBS3D/pH/B7yvCaGx X-Google-Smtp-Source: AAOMgpexqZ76tZSQcwKYwl11/E66q95EjBDLoDD2cL95tpPB+99yUCN+F0ry3NUljNXK9FTiE+1QyPk4OIv12gC0B7c= X-Received: by 2002:a19:cd8c:: with SMTP id d134-v6mr5785857lfg.41.1533324381157; Fri, 03 Aug 2018 12:26:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 3 Aug 2018 13:26:03 -0600 Message-ID: To: mail@pmmaga.net Cc: internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] On abstract methods defined on traits From: levim@php.net (Levi Morrison) On Fri, Aug 3, 2018 at 11:09 AM Pedro Magalh=C3=A3es wrot= e: > > Hi internals, > > On the documentation about traits there is a mention to: "Traits support > the use of abstract methods in order to impose requirements upon the > exhibiting class." in > https://secure.php.net/manual/en/language.oop5.traits.php#language.oop5.t= raits.abstract > > However, this is not true, and it has never been since traits were > introduced (https://3v4l.org/tYAmu). > > There is a related bug report in https://bugs.php.net/bug.php?id=3D75449 > > What currently happens is that (like with normal methods), the method on > the receiving class is used and the method from the trait is simply ignor= ed. > > Although this can be fixed, I wanted your opinion on it as this would be > the only thing from traits that would impose anything on the receiving > class and conflicts with the normal precedence rules. > > Regards, > Pedro It's partly true; an abstract method in a trait will require that the using class to have a method of the same name but nothing else. In my opinion the docs should be changed, not trait behavior.