Skip to content

new static::$classNameA() should not be an error #482

Open
@samurai00

Description

@samurai00

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();
    }
}

2017-09-25 22 08 34

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions