Open garrettw opened 7 years ago
What version you are using?
I am trying to get error on snippets:
class Test
{
private static $propOne, $propTwo;
public function test()
{
self::$propOne++;
self::$propTwo++;
}
}
And this
class Test
{
private static $propOne, $propTwo;
}
Nothing...
I'm using the latest release, 0.6.2. As there has been almost 150 commits since then, maybe it's time for a new release.
@garrettw I started to work on phpsa
, possible will try to release ASAP after big changes!
If I have a class that contains something like this:
What happens is that after parsing, the resulting
ClassDefinition
contains both properties, but only one property statement (named for only$propTwo
, incidentally).So far, this partly seems to make sense, but the problem comes in
PHPSA\Compiler\Expression\StaticPropertyFetch::compile()
which has the following code:With the code sample given above,
hasProperty()
returnstrue
for$propOne
, making it skip the firstif
block. Then, because there is no property statement named for$propOne
, callinggetPropertyStatement()
returnsnull
. So, on line 46,$property
is set tonull
, making the call toisStatic()
cause a fatal error.