Invalid start location for class constants / properties
See original GitHub issueInput:
<?php
class A
{
const test = 1;
}
AST (excerpt):
"kind": "classconstant",
"loc": {
"source": "test = 1",
"start": {
"line": 4,
"column": 10,
"offset": 26
},
"end": {
"line": 4,
"column": 18,
"offset": 34
}
},
I think the start column of the class constant is off, it should be around 4 instead of 10 in the example.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Using class constants for [Range] attribute - Stack Overflow
The following example demonstrates how one can use (constant)properties from a class as values used with the Range attribute from NUnit.
Read more >Class Constants - Manual - PHP
As of PHP 8.1.0, class constants cannot be redefined by a child class if ... Same constant name can be used as a...
Read more >Use of Persistent Variables in Class Methods Producing ...
I am attempting to make use of a persistent variable within a class method. However, invoking the method from different instances is producing...
Read more >Understanding Class Members (The Java™ Tutorials ...
Every instance of the class shares a class variable, which is in one fixed location in memory. Any object can change the value...
Read more >Python Constants: Improve Your Code's Maintainability
__slots__ Attribute; The @property Decorator; The namedtuple() Factory ... You just have to change the value in a single place: the constant ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doesn’t matter as long as we get it fixed 😉
Hi @evilebottnawi, it would be great if you have some time that you keep working on branch #fix-issue-511 as the fix is not fully implemented.
Remains to check interfaces, traits, use alias on traits, but the principle remains the same as in the last commit