Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94311 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82747 invoked from network); 28 Jun 2016 17:57:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jun 2016 17:57:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.220.53 mail-pa0-f53.google.com Received: from [209.85.220.53] ([209.85.220.53:33236] helo=mail-pa0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/C6-41838-1AAB2775 for ; Tue, 28 Jun 2016 13:57:54 -0400 Received: by mail-pa0-f53.google.com with SMTP id b13so8595414pat.0 for ; Tue, 28 Jun 2016 10:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=qdrfWF4Hi86JiIBsQ7U8X4thcS1Hs0ylEJiB2s30Fs4=; b=lCNvPWJLIPvQIXRr6IMaQ1jO0dIF5WB1LjQMbKquNK3UvW0k3VAkpokJ5XaVyF5/k9 S4dqsVXDcLhHcOjW25clHUh/p9HKmrBuII6s4e7HKBbn4dTxqn7U25ZrUi1a32FZ3GSR 7HU/LXxFq32dPDRJ6MFPtOnf56B80WdpJubePaLVkiW7AOjpf1Gp08lXBeQE/1hw5jvh 8bN1pvs7OZikSk9cJYCLiwkBi0st/yOomoeUOn1cYJK+VrFVdWxRiOzRbUAF7tkkTble u1aQcTs/yQkrT9u7G3AhgaImUL08hvaRfLwLHlTce15O3CKpLYaIznyEVGvEhd9WMRfL xNZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=qdrfWF4Hi86JiIBsQ7U8X4thcS1Hs0ylEJiB2s30Fs4=; b=Dq0Ux66Ww2SY1RHOSHyWPSCmMBdpHkLKDzr+jJsUdfiRen7IrEOHCoWDgDnvTntKW4 ae2IAMh8t3qpphJAUgiYzsBkS3aGp622mGsDFbmRsJuaAATU0ZZ6DP/6aQoLmvM30OQN 2kfLJ++h0DCdf80ry8BfDCZI9B71cdTs1xiZwdkMn/uz8ZcXSbq13VB/sulceS4Vi+sU JK3Xb2roH7IeKnaz5ewMOLo40CU6oZU91IkQyXq0jaZbQvxqt0cpHFM+k3K3jeO7yXMq eJVz9Itf+SFEUU2MbkThSr+QSm3l3BjvlfOhH730WepzFr2pyw3Lw0Bs79yX8SYr8r1P 4mow== X-Gm-Message-State: ALyK8tI4dnwriiN9aQQ2n4Yn5qNEtNR2eSR6pCZWBPseg8RQfmFNWbRglu3ZlziJut5uVQ== X-Received: by 10.66.135.40 with SMTP id pp8mr4000753pab.113.1467136670996; Tue, 28 Jun 2016 10:57:50 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id 78sm780753pfm.43.2016.06.28.10.57.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jun 2016 10:57:50 -0700 (PDT) To: internals@lists.php.net References: <211db59e-9c22-6df4-1f72-66ebbc5095bd@fleshgrinder.com> Message-ID: Date: Tue, 28 Jun 2016 18:56:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Simple Annotations From: rowan.collins@gmail.com (Rowan Collins) On 28/06/2016 17:31, Rasmus Schultz wrote: > For another, eager construction means we can filter annotations with > instanceof rather than by class-name, which is much powerful, enabling > you to leverage inheritance - for example, you'd be able to ask > directly for all instances of ValidationAnnotation and get those with > a single call, which is incredibly useful. Sorry for the extra mail with only one point, but I missed this before. This can be achieved using the fully-qualified class-name by using is_a() or is_subclass_of(). This obviously needs to trigger the autoloader anyway, but can still avoid actually instantiating the class. (And thus, per my other mail, evaluating the args.) I think lazy construction (without magic stub classes) gives the best of both worlds here.