RE: [PHP-DEV] PHP 4.0 Bug #7598 Updated: modify "new" syntax
| From: | Mike Heath | Date: | Thu, 02 Nov 2000 19:52:15 +0000 |
| Subject: | RE: [PHP-DEV] PHP 4.0 Bug #7598 Updated: modify "new" syntax | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-36821@lists.php.net to get a copy of this message | ||
To verify that it is copied see the examples in bugs: 7511, 7482, 7455,
7454, 6529. This problem has been reported a number of times by numerous
people but has only received attention within the past short while.
Thanks,
Mike Heath
waldschrott@php.net wrote:
how did you verify/find out that it is copied?
Previous Comments:
---------------------------------------------------------------------------
[2000-11-02 13:59:11] danjrod@terra.es
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
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7598
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net