Date: 01/19/01
- Next message: iamhere <email protected>: "[PHP-DEV] PHP 4.0 Bug #8797: There is no way to use REC_VERSION transaction parameter"
- Previous message: szii <email protected>: "[PHP-DEV] odbc_columns() and DB2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: rick <email protected>
Operating system: All
PHP version: 4.0.4pl1
PHP Bug Type: Feature/Change Request
Bug description: $foo->bar->baz should not be ambiguous
In PHP4 it is possible to construct an object and refer to
a member using the notation:
$foo->bar
where foo is the object and bar is the member.
There has been some discussion in the php.net documentation
area on OO about the inability to further extend this
notation to do something like:
print "$foo->bar->baz";
The reason given for not being able to do this is due
to the ambiguity of the multiple -> operators.
Yes, the -> operator could be ambiguous. The '+', '*', '%', ... operators could also be ambiguous. Each language which
uses such binary operators disambiguates them by defining
and associativity and precedence to these operators.
Similarly, for languages which support similar semantics
for an -> operator there is a disambiguating assignment
of associativity and precedence which allows constructs
like $foo->bar->baz to be unambiguously interpreted.
I am requesting that the specification for PHP be broadened
to include sufficient associativity and precedence constraints on -> to allow $foo->bar->baz to be disambiguated.
I believe the most common disambiguation would have:
$foo->bar->baz
refer to "the value of the member 'baz' of the object denoted by the value of the member 'bar' of the object denoted by the value of the variable foo."
Of course, I forget at the moment whether that's left- or right-associative, and the precedence should presumably be fine set at its current level.
-- Edit Bug report at: http://bugs.php.net/?id=8796&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: iamhere <email protected>: "[PHP-DEV] PHP 4.0 Bug #8797: There is no way to use REC_VERSION transaction parameter"
- Previous message: szii <email protected>: "[PHP-DEV] odbc_columns() and DB2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

