kphp icon indicating copy to clipboard operation
kphp copied to clipboard

Misleading error message when nonexisting class is used in field default initializer

Open quasilyte opened this issue 4 years ago • 0 comments

<?php

use Some\Nonexisting;

class Foo {
  public static $v = [
    Nonexisting::C => 1,
  ];
}

Expected result: error about the nonexisting class. Actual result:

Compilation error at stage: Calc const types, gen by calc-const-types.cpp:21
  example.php:0

Default value of Foo::$v is not constant

quasilyte avatar Mar 26 '21 13:03 quasilyte