Bug #67772 [NEW]: Member-Selection Operator Syntax

From: Date: Tue, 05 Aug 2014 16:52:28 +0000
Subject: Bug #67772 [NEW]: Member-Selection Operator Syntax
Groups: php.standards 
Request: Send a blank email to standards-+get-325@lists.php.net to get a copy of this message
From: joelm Operating system: PHP version: Irrelevant Package: PHP Language Specification Bug Type: Bug Bug description:Member-Selection Operator Syntax Description: ------------ https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#member-selection-operator The specified syntax is wrong. PHP does not allow arbitrary expressions to follow the "->" token, if the programmer wants to use an expression (aside from a bare local variable) they have to wrap it in curly braces. This section makes it sound like instance properties and methods both live in the same namespace (which is wrong, they have distinct namespaces and you can have a method and an instance property with the same name). Also, the description of the member-selection operator is not precise enough to allow the reader to distinguish between an arrow-style method call expression and an instance property access, which is key to describing how a parsed expression involving the -> operator is interpreted by the engine. Finally, this section doesn't describe how arrow-style method lookup or instance property lookup works. For example if there is a private property named 'x' and a public property named 'x' in the inheritance hierarchy, how do we decide which one gets accessed? Same goes for methods. -- Edit bug report at https://bugs.php.net/bug.php?id=67772&edit=1 --

« previous php.standards (#325) next »