Skip to content

Conversation

@thekid
Copy link
Member

@thekid thekid commented Feb 15, 2020

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

@thekid thekid merged commit fd0ad6e into master Mar 28, 2020
@thekid thekid deleted the feature/scope_chaining branch March 28, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants