Hello Christian,

  cool progress and nice syntax. The only thing I was wondering of is
whether the following would work:

   function replace_spaces ($text) {
     static $replacement = function ($matches) {
       return str_replace ($matches[1], ' ', ' ').' ';
     };
     return preg_replace_callback ('/( +) /', $replacement, $text);
   }

That is using static would result in creating the function only once.

marcus

p.s.: Given the current state, my take is put it in and finish the last
two or three edgecases while namespace and GC mature. Actually we still
haven't had the namespace syntax decision. All thta happened there was we
will apply the patch as is and when it is done we'll discuss. Now when the
namespaces were said to be ready someone just put the discussion down.
Clever politics. However namespaces are imo far from being finished.
Either way this feature is lkimited enough, stable enough, agreed up-on
enough and gives something a lot of people were waiting for. Let's do it
now. PHP 6 even when focused on will come with another ton of major new
features. That is unicode, still pretty much untested. Also there are
traits waiting and then we might want to have the taint model. Personally
given it's last state of 1% slowdown I really want it. So put all together
we should avoid 5.4 and put smaller features into 5.3 and once we're out
with 5.3.1 we should close 5.2 branch, only apply fixes and security
issues to 5.3 and get 6 in a working state.

marcus

Wednesday, July 2, 2008, 1:41:20 PM, you wrote:

> Hi,

> After some discussion with Dmitry, he and I have continued to improve
> the current closure patch. You can find the current proposal with
> patches for 5_3 and HEAD here:

> http://wiki.php.net/rfc/closures

> (Please read it again, I've changed quite a lot.)

> Basically, it's the syntax with use ($lexical) in the function
> declaration, optional references, optional static keyword for functions
> that don't need $this and support for __invoke. I know that there was
> some disagreement on the syntax (including by me) but I think this is
> the best compromise we can achieve while still staying consistent with
> PHPs current semantics and not breaking BC at all.

> I've spoken to Dmitry and he said the patch will be committed to HEAD
> soon. Since both Dmitry and I still want to have it in 5_3 too, we'd
> want to ask for opinions on this again - especially since after quite a
> lot of thorough review and discussion on this list basically all the
> side-effects have been addressed and there are now quite a few tests
> that ensure the correct behaviour of closures. Also, the patch is now
> built in a way that the main functionality remains inside
> zend_closures.c, so any possible not yet encountered bug can be fixed
> without breaking binary compability.

> Regards,
> Christian




Best regards,
 Marcus


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

Reply via email to