Skip to content

Implement `::class` static property

This property contains the name of the class in PHP. In the second commit, I also added very barebones namespace tracking, so the class property can be resolved correctly for classes inside namespaces.

See https://secure.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class

This conflicts with !2 (merged), I'll rebase if one of these get merged :)

// input
class Foo {}
namespace Bar { class Xyz {} }
Foo::class;
// output
class Foo {
  static class = "Foo";
};
{//Bar
  class Xyz {
    static class = "Bar\\Xyz";
  };
}
Foo.class;

Merge request reports