Req #64939 [Opn->Csd]: Please make {$c->worker}() valid
| From: | laruence@php.net | Date: | Tue, 04 Jun 2013 15:59:35 +0000 |
| Subject: | Req #64939 [Opn->Csd]: Please make {$c->worker}() valid | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-179320@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64939&edit=1
ID: 64939
Updated by: laruence@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