facebook / facebook/hhvm

Support abstract consts, ban redefining consts in all circumstances

Open
#3,005 2 comments 0 reactions 0 assignees View on GitHub
feature request hack
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

This is currently fine:

``` PHP
class A {
const FOO = 'bar';
}

class B extends A {
const FOO = 'baz';
}
```

Ideally, this would just be forbidden - however, static::BAR is used in some patterns. One way to ban this in the general case would be to support abstract constants.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.