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

 ID:                 64939
 Updated by:         larue...@php.net
 Reported by:        ext dot rmolotkiewicz at gmail dot com
 Summary:            Please make {$c->worker}() valid
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            *General Issues
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

actually, there is already a similar PR,

which will allow ($c->woke)();

see: https://github.com/php/php-src/pull/301

close this since it was already addressed by other report


Previous Comments:
------------------------------------------------------------------------
[2013-05-28 14:47:25] ext dot rmolotkiewicz at gmail dot com

Description:
------------
Allowing syntax like {$c->worker}() would help to solve ambiguity.

Test script:
---------------
<?php
class Worker {
  public function __invoke() {
    echo "invoked\n";
  }
}

class Caller {
  public $worker;

  public function __construct($worker) {
    $this->worker = $worker;
  }

  public function __call($name, $arguments) {
    echo "called\n";
  }
}

$c = new Caller(new Worker());
echo $c->worker(); // should output "called"
echo {$c->worker}(); // should output "invoked"
?>

Expected result:
----------------
called
invoked

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


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



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

Reply via email to