#48246 [NEW]: Allow the new statement to be a value.
| From: | mathieu dot suen at easyflirt dot com | Date: | Tue, 12 May 2009 14:53:44 +0000 |
| Subject: | #48246 [NEW]: Allow the new statement to be a value. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-137205@lists.php.net to get a copy of this message | ||
From: mathieu dot suen at easyflirt dot com
Operating system: not relevant
PHP version: 5.2.9
PHP Bug Type: Feature/Change Request
Bug description: Allow the new statement to be a value.
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 bug report at http://bugs.php.net/?id=48246&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48246&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48246&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48246&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48246&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48246&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48246&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48246&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48246&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48246&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48246&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48246&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48246&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48246&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48246&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48246&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48246&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48246&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48246&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48246&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48246&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48246&r=mysqlcfg