Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101941 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 17595 invoked from network); 28 Feb 2018 20:57:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2018 20:57:55 -0000 Authentication-Results: pb1.pair.com header.from=david.proweb@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=david.proweb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.181 as permitted sender) X-PHP-List-Original-Sender: david.proweb@gmail.com X-Host-Fingerprint: 209.85.223.181 mail-io0-f181.google.com Received: from [209.85.223.181] ([209.85.223.181:41636] helo=mail-io0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/4C-25585-1D7179A5 for ; Wed, 28 Feb 2018 15:57:54 -0500 Received: by mail-io0-f181.google.com with SMTP id q24so4720085ioh.8 for ; Wed, 28 Feb 2018 12:57:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=6eR1v4UPEjNlKCyVW7K3xy6HeZQkPhSXMtFMEMzEyQA=; b=mAcp3PkUS297YmrSQusuNWumJ3KeZ98fcqHS47YUsHAjmI7nMBlApPEPsPC57eJOR8 UwOgXLlsmywOLBgcoaQPKFdnNTL4dMeaGB3INrUj28gjWBZf8+ApiRHwJmKavhMcK+vr r/pSdFnJB1PtYS+QPb2wNAqbNZgsm/GnDR75F8b8jtdSLLA5hzirpZ1RqMEU4EHykYqQ WuZfpIaxwVaJdZtYjq4xFhB7yS48r0gAgUCdHHOr5CUsKmKJwHiVGDi/H85FzW1oq9aH zrPKkJfFBpO4MfULUuEG/UTxLUhCbXSJHYbDmM8vWzRhpsIfKH8X+ZTxHlgwCtdI/Wbm Zmkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6eR1v4UPEjNlKCyVW7K3xy6HeZQkPhSXMtFMEMzEyQA=; b=saggFAg/DM+wu47dD/tqHTeBwHo6oMs9NkX+T9uITyi7g71U6oNsG/xGK38VLZ0oRj rBnaT7qknofC636sadwejYuGEljbYY/ZNRxP33oUxO3zp3HdbYGMoLXT1+3w9k2t8wmr x6xlvU2f/slJvK+DLH/8tw1zLEsKQ22ZMqkVNBQURrjM8pJP4HhGZBlJOOsVN+bUfwU0 rE3OZ3p5s0MKq4+O5T/crjBb0KhyUZR1CaPfF+5UXhY95S1eB2Zwh6J8sPVTSfT2Obyi OZz8zOCN5KasUXIwOmXx2S9+E6l3I+slY/vPQ26Ik5NBcIdKIgp42qND17SICjJCf6XU H+JQ== X-Gm-Message-State: APf1xPDbr4q/oORKNmCXRHAcGMiCThSI/fvh43xQXUGMtYoJ8gw9EZyb pDJQIKaARNuWXP7v5szFl3u7CqC6c+Q2kjVnVMdmrA== X-Google-Smtp-Source: AG47ELvw9pVVHdFIJ5ys3gZOsrAq1dIBppD0UqDAnfUoYscVvJf0hqkFmWaeilLQrtjrHQI1sjgNNfKyLfJ07gWP7wY= X-Received: by 10.107.13.142 with SMTP id 136mr16169030ion.265.1519851471025; Wed, 28 Feb 2018 12:57:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.118.74 with HTTP; Wed, 28 Feb 2018 12:57:30 -0800 (PST) Date: Wed, 28 Feb 2018 17:57:30 -0300 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="001a113fe3700ac91a05664bff2a" Subject: Traits with interfaces From: david.proweb@gmail.com (David Rodrigues) --001a113fe3700ac91a05664bff2a Content-Type: text/plain; charset="UTF-8" Why traits doesn't supports interfaces (via implements) like classes does? It could be useful when trait implements part of abstract functions from interface, then the class that uses this traits should implements the another part. It could turn it possible (pseudo-code): interface VisibilityControlContract - public function isVisible(): bool; trait VisibilityControlTrait implements VisibilityControlContract - public function isVisible(): bool { ... } class UserModel (not need implements VisibilityControlContract directly) - uses VisibilityControlTrait; var_dump(new UserModel instanceof VisibilityControlContract); // true The disvantages that I can see with that is that without an IDE I could not identify easily if interface was implemented by some trait. But it too happen when I do implements an abstract class that implements some interface. -- David Rodrigues --001a113fe3700ac91a05664bff2a--