xp-framework / compiler

Compiles future PHP to today's PHP.
19 stars 0 forks source link

Allow chaining scope resolution operator `::` #82

Closed thekid closed 4 years ago

thekid commented 4 years ago

See php/php-src#5061

class T {
  const TYPE = self::class;

  public static function new() { return new self(); }
}

$t= T::TYPE::new();  // a T instance

Previously, this would have required a temporary variable:

$type= T::TYPE;
$t= $type::new();  // a T instance