Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70637 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7612 invoked from network); 14 Dec 2013 13:51:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2013 13:51:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.47 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.128.47 mail-qe0-f47.google.com Received: from [209.85.128.47] ([209.85.128.47:35880] helo=mail-qe0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/A3-11187-0626CA25 for ; Sat, 14 Dec 2013 08:51:29 -0500 Received: by mail-qe0-f47.google.com with SMTP id t7so2541188qeb.20 for ; Sat, 14 Dec 2013 05:51:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=N7kITgsgJgydsv25ooJUq/MWljbhxgboECSZA05L5CA=; b=VGc5IRWmi0klLJRjDmYH+su1bZtXmPa7Iyjfv7NKgz2qnQT84aK/M7KqrnmkDjSl+b bF+UwzsBFwK8wHS8cU7nsvO4fTj1+ZMyT31B1tlfC4yMEej+uNg1j1+4HXKIX5vkxyqI tudeCuJZfbWLGeqWqe6j8UrYvb7p5wAhuIOFtqOvxQOdmwsr7gCimCr2ovgVzowIJS7N DnQ42s2u/CeqA6rqmhVJPlicsn6qhGXgC3m7/JgncML+bKpd9vz6LZBe8frnvDsPweo+ ccxUT2r5A6TT4mGJS0QwsnRMA4MkJPG6yQ6OsSTpVytrr1dE2HmsZzToYDw57H5joQ4g wbYw== X-Received: by 10.224.15.130 with SMTP id k2mr14654973qaa.101.1387029085194; Sat, 14 Dec 2013 05:51:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.85.149 with HTTP; Sat, 14 Dec 2013 05:51:05 -0800 (PST) In-Reply-To: <52AC5E19.8060203@lsces.co.uk> References: <52ABA642.9090206@php.net> <52ABA947.4030908@ajf.me> <52AC5E19.8060203@lsces.co.uk> Date: Sat, 14 Dec 2013 14:51:05 +0100 Message-ID: To: Lester Caine Cc: PHP Internals List Content-Type: multipart/alternative; boundary=047d7bdcad4cea90ca04ed7edf78 Subject: Re: [PHP-DEV] Proposal for RFC: get_class_constants() From: ocramius@gmail.com (Marco Pivetta) --047d7bdcad4cea90ca04ed7edf78 Content-Type: text/plain; charset=UTF-8 On 14 December 2013 14:33, Lester Caine wrote: If it is the only reason you are having to activate reflections? Reflections would seem to have a place, but is it really necessary to add yet another layer when most of the time it's function is provided better by IDE tools anyway? This is a simple example of a current hole in the core PHP tools which would help a section of developers who don't need the overheads of additional layers. @Lester additional layer is still better than *yet another shortcut*. Since we already have the feature, introducing another flavor for it seems a bit of an overkill, especially if it also has to be maintained. Any userland implementation can handle this by also being fast enuff: function get_class_constants($className) { static $cached = []; if (isset($cached[$className])) { return $cached[$className]; } return $cached[$class] = (new \ReflectionClass($class))->getConstants(); } Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --047d7bdcad4cea90ca04ed7edf78--