Req #48246 [Opn->Dup]: Allow the new statement to be a value.
| From: | aharvey@php.net | Date: | Tue, 23 Nov 2010 09:33:20 +0000 |
| Subject: | Req #48246 [Opn->Dup]: Allow the new statement to be a value. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156304@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=48246&edit=1
ID: 48246
Updated by: aharvey@php.net
Reported by: mathieu dot suen at easyflirt dot com
Summary: Allow the new statement to be a value.
-Status: Open
+Status: Duplicate
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: not relevant
PHP Version: 5.2.9
Block user comment: N
Private report: N
New Comment:
Duplicate of request #34502.
Previous Comments:
------------------------------------------------------------------------
[2009-05-12 14:53:43] mathieu dot suen at easyflirt dot com
Description:
------------
The new statement can only be use insid a assignement statement.
ex: $a = new A();
It would be better to also allow it in other statement like the
invokation:
(new A())->foo()
In other word "new A()" should be a valuable statement.
Reproduce code:
---------------
(new A())->foo()
Expected result:
----------------
The method foo() is invoked on the newlly created object
Actual result:
--------------
Compilation error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=48246&edit=1