Hi!
>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 on
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_ca
On Thu, Jul 03, 2008 at 10:30:43PM +0400, Dmitry Stogov wrote:
> I don't see big problems with closures. The patch is simple and stable.
While you're probably right, it seems there is still lots of discussion
about how closures should work. It seems better to get this right in a
later version t
On Fri, 2008-07-04 at 11:31 +0200, Lars Strojny wrote:
> Hi Johannes,
>
> Am Freitag, den 04.07.2008, 11:18 +0200 schrieb Johannes Schlüter:
> > Now such a check isn't possible, all reflection information on the
> > callback I can get is that it is an object of type Closure having a
> > method __i
Hi Johannes,
Am Freitag, den 04.07.2008, 11:18 +0200 schrieb Johannes Schlüter:
> Now such a check isn't possible, all reflection information on the
> callback I can get is that it is an object of type Closure having a
> method __invoke() with zero required parameters. There's no further
> informa
Hi,
On Thu, 2008-07-03 at 22:30 +0400, Dmitry Stogov wrote:
> I don't see big problems with closures. The patch is simple and
stable.
> It's main part isolated in zend_closures.c and it doesn't affect other
> parts of engine.
Changes too the languages always introduce some side effects and
theref
On Thu, 03 Jul 2008 11:06:48 +0200, Christian Seiler <[EMAIL PROTECTED]> wrote:
> Hi,
>
>> 1) The RFC page says that closures pass by value by default. Although
> it is
>> not stated, am I correct in saying that due to the way resources and
> objects
>> (and presumably therefore lambdas) are han
n (1) and
(2).
Andi
-Original Message-
From: Dmitry Stogov [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 03, 2008 12:27 AM
To: Lukas Kahwe Smith
Cc: Christian Seiler; php-dev List
Subject: Re: [PHP-DEV] [RFC] Closures: updated proposal and patch
Hi Lukas,
From my point of view the propo
Given the 5.3 is not yet out (even as a Beta) I think discussing 5.4
is way way premature. For now I think 5.3 is close enough to 6 in
feature set to not warrant 5.4. I think the effort at this point
should be spent on getting 5.3 out and figuring out how to proceed
with PHP 6.
On 3-Jul-
PROTECTED]
>> Sent: Thursday, July 03, 2008 12:27 AM
>> To: Lukas Kahwe Smith
>> Cc: Christian Seiler; php-dev List
>> Subject: Re: [PHP-DEV] [RFC] Closures: updated proposal and patch
>>
>> Hi Lukas,
>>
>> From my point of view the proposed closures concep
12:27 AM
> To: Lukas Kahwe Smith
> Cc: Christian Seiler; php-dev List
> Subject: Re: [PHP-DEV] [RFC] Closures: updated proposal and patch
>
> Hi Lukas,
>
> From my point of view the proposed closures concept is very consistent
> and implementation doesn't complicate the
Hi,
1) The RFC page says that closures pass by value by default. Although it is
not stated, am I correct in saying that due to the way resources and objects
(and presumably therefore lambdas) are handled they will still have the
effect of passing by reference anyway, just as with a function p
On Jul 3, 2008, at 4:41 AM, Lukas Kahwe Smith wrote:
Absolutely agree.
I don't see any reason for 5.4. We don't plan any significant new
features.
You guys are scaring me ..
I was hoping to evade such discussions. PHP 5.3 is probably the
minor version release with the most major changes eve
On 03.07.2008, at 10:34, Dmitry Stogov wrote:
Absolutely agree.
I don't see any reason for 5.4. We don't plan any significant new
features.
You guys are scaring me ..
I was hoping to evade such discussions. PHP 5.3 is probably the minor
version release with the most major changes ever.
Absolutely agree.
I don't see any reason for 5.4. We don't plan any significant new features.
Thanks. Dmitry.
Derick Rethans wrote:
> On Wed, 2 Jul 2008, Lukas Kahwe Smith wrote:
>
>> On 02.07.2008, at 13:41, Christian Seiler wrote:
>>
>> So as things look atm, closures will have to wait until
Derick Rethans wrote:
On Wed, 2 Jul 2008, Lukas Kahwe Smith wrote:
On 02.07.2008, at 13:41, Christian Seiler wrote:
So as things look atm, closures will have to wait until then. But cool
features like closures, traits etc will undoubtedly increase the incentive to
get working quickly on 5.4 an
On Wed, 2 Jul 2008, Lukas Kahwe Smith wrote:
> On 02.07.2008, at 13:41, Christian Seiler wrote:
>
> So as things look atm, closures will have to wait until then. But cool
> features like closures, traits etc will undoubtedly increase the incentive to
> get working quickly on 5.4 and this can happ
Hi Lukas,
>From my point of view the proposed closures concept is very consistent
and implementation doesn't complicate the engine at all. The code
without closures will work without any changes, but code with closures
(instead of eval() and create_function()) will work significant faster
as lambd
On Wednesday 02 July 2008 6:41:20 am Christian Seiler 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
On 02.07.2008, at 13:41, Christian Seiler wrote:
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 discu
Hi Stanislav,
Or did you just mean $example->setSearch() and I'm worried about
nothing? :)
Yes, absolutely, Sorry for the confusion caused. ;-)
I fixed that in the Wiki.
In this case, I'd just propose to have getThis() anyway.
I don't see a need, but I'm not against it. Should be extremel
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 t
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 ($le
23 matches
Mail list logo