Re: PROPOSAL: new class entry for grouping functions, consts and vars
| From: | Gareth Evans | Date: | Fri, 20 Sep 2013 07:13:52 +0000 |
| Subject: | Re: PROPOSAL: new class entry for grouping functions, consts and vars | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69243@lists.php.net to get a copy of this message | ||
On 20 September 2013 07:13, kuzuha <kuzuha01@gmail.com> wrote:
> I think autoload is very nice solution to avoid that problem.
>
> Autoloading skips unnecessary code and makes php faster.
>
> The "definition" block means Grouped defines. That gives autoloading
>
> to function, consts and vars. And PSR-0 helps simplify directory tree.
Can you not just have a class defined final and use that?
> Pros:
>
> * Never mind where to put .php file for definitions. Following PSR-0 is
> nice idea.
>
> * Can refactoring definitions without hesitation.
>
> * Separate implementation from definition specifically.
So, I'm sure the following meets the criteria of all of most of the
tests in your example;
<?php
final class FooConstants
{
const BAR = 'baz';
}
Also, I'm not sure where having static methods available is of use to
solve the problem of constants.
This doesn't bring any new functionality to PHP, just a different way
of doing something. If I'm missing something please elaborate.