Edit report at https://bugs.php.net/bug.php?id=55828&edit=1

 ID:                 55828
 Comment by:         design at oleku dot org
 Reported by:        connec dot 2002 at gmail dot com
 Summary:            Instantiation and call in one expression.
 Status:             Open
 Type:               Feature/Change Request
 Package:            Class/Object related
 Operating System:   Irrelevant
 PHP Version:        5.4.0beta1
 Block user comment: N
 Private report:     N

 New Comment:

I totally agree ..


Previous Comments:
------------------------------------------------------------------------
[2011-10-01 23:49:32] connec dot 2002 at gmail dot com

Description:
------------
It would be nice if object instantiation and calling methods on the object 
could 
occur within the same expression.

Test script:
---------------
class A {
  public function method() {
    echo "call\n";
  }
}

new A(/* args, mayhaps */)->method();
new A->method();

Expected result:
----------------
call
call

Actual result:
--------------
Parse error:  syntax error, unexpected '->'


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55828&edit=1

Reply via email to