new static::$classNameA(); is detected as an error.
It reports ';' excepted.
But new self::$classNameA(); is ok.
I think new static::$classNameA(); should not be detected as an error.
Example code:
<?php
namespace App;
class Test
{
protected static $classNameA = A::class;
protected static $classNameB = B::class;
public function a()
{
$a = new static::$classNameA();
$a->output();
}
public function b()
{
$b = new self::$classNameB();
$b->output();
}
}

@roblourens
I opened an issue on the parser: https://github.com/Microsoft/tolerant-php-parser/issues/194
<?php
if (static::$instance instanceof static) {
return true;
}
This will also report an error.
If you want something to test against:
https://github.com/silverstripe/silverstripe-framework/blob/3.6/dev/Log.php#L94
file: 'file:///c%3A/Users/jake/www/projects/ptv-mpw/htdocs/framework/dev/Log.php'
severity: 'Error'
message: '';' expected.'
at: '94,32'
source: 'php'
This has now been fixed in Microsoft/tolerant-php-parser#194 :)
Most helpful comment
I opened an issue on the parser: https://github.com/Microsoft/tolerant-php-parser/issues/194