Hi!

Re-reading the proposal, I encountered something unexpected:

$replacer = $example->getReplacer ('goodbye');
echo $replacer ('hello world'); // goodbye world
$replacer->setSearch ('world');
echo $replacer ('hello world'); // hello goodbye

Does it mean closure would forward all method calls to it to the enclosed object? Not sure if it's a good idea - seems too magical. Maybe we need to be more explicit, something like $replacer->getThis()->setSearch('world')? I.e., if you have object of type Closure, you can't actually know what methods it has - it'd depend on $this inside, which we don't have access to right now. That seems kind of strange. Or did you just mean $example->setSearch() and I'm worried about nothing? :) In this case, I'd just propose to have getThis() anyway.

Except for that - excellent work!
--
Stanislav Malyshev, Zend Software Architect
[EMAIL PROTECTED]   http://www.zend.com/
(408)253-8829   MSN: [EMAIL PROTECTED]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to