PHP 4.0 Bug #7598: modify "new" syntax
| From: | danjrod at terra dot es | Date: | Thu, 02 Nov 2000 18:59:12 +0000 |
| Subject: | PHP 4.0 Bug #7598: modify "new" syntax | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-36814@lists.php.net to get a copy of this message | ||
From: danjrod@terra.es
Operating system: All
PHP version: 4.0.3pl1
PHP Bug Type: Feature/Change Request
Bug description: modify "new" syntax
Assigning the value returned by "new xxxx()" to a variable creates a copy of the
constructed object.
"new" does not support returning references by default, or prepending an ampersand,
'&', to have a reference returned.
Thus the request is:
- Modify new syntax to either:
a) It always returns a reference. This is unlikely to
break any existing code. At most people will be
creating a reference to a reference, which won´t harm
b) Support the '&' syntax like in "&new xxx", so that
a reference can be asked for. This will not break
any existing code.
This only implies slightly modifying "zend-parser.y", and
no further changes to any part of the zend engine.
This change will cure the use of "$this" as a reference inside the object constructor,
which has been wrongly dismissed as a "circular reference problem".
Regards
Daniel
--
Edit Bug report at: http://bugs.php.net/?id=7598&edit=1