Re: [PHP-DEV] [RFC] Closures, Lambdas and use

2009-01-04 Thread Stanislav Malyshev
Hi! some time back (August 08) I complained about 'use' being at a weird position and not at the same place as 'global' or 'static' where I expected it. Back then Dmitry asked me to provide a patch to check out the alternative. Now during the holidays I finally found some time to change from:

Re: [PHP-DEV] [RFC] Closures, Lambdas and use

2009-01-04 Thread Larry Garfield
On Sunday 04 January 2009 8:17:27 pm Marcus Boerger wrote: > Hello Larry, > > > > $f = function() use ($y, &$z) { > > global $x; // By reference > > } > > > > $y is clearly by value, and $z clearly by reference, as that parallels > > the way function parameters work right next to the lexical va

Re: [PHP-DEV] [RFC] Closures, Lambdas and use

2009-01-04 Thread Marcus Boerger
Hello Larry, Sunday, January 4, 2009, 10:05:25 PM, you wrote: > On Sunday 04 January 2009 10:45:30 am Sebastian Bergmann wrote: >> Marcus Boerger schrieb: >> > $f = function() { use $x; } >> >> +1 for consistency. > +1 for consistency as well, which is why, as I recall, that syntax was > rejec

Re: [PHP-DEV] [RFC] Closures, Lambdas and use

2009-01-04 Thread Larry Garfield
On Sunday 04 January 2009 10:45:30 am Sebastian Bergmann wrote: > Marcus Boerger schrieb: > > $f = function() { use $x; } > > +1 for consistency. +1 for consistency as well, which is why, as I recall, that syntax was rejected. $f = function() { global $x; // By reference. use $y; // By va

Re: [PHP-DEV] [RFC] Closures, Lambdas and use

2009-01-04 Thread Sebastian Bergmann
Marcus Boerger schrieb: > $f = function() { use $x; } +1 for consistency. -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69 -- PHP Internals - PHP Runtime Development Mailing List To unsubscr

Re: [PHP-DEV] [PATCH] Bug #46806 - mb_strimwidth

2009-01-04 Thread Moriyoshi Koizumi
Hi, This behavior seems strange, but the rationale of this function is that the (east asian) width of the resulting string does not exceed the specified value so that it would fit to a fixed sized box when rendered in the browser, assuming the string would be displayed with a monospace font.

[PHP-DEV] [RFC] Closures, Lambdas and use

2009-01-04 Thread Marcus Boerger
Hello Internals, Dmitry, Lukas, Johannes, some time back (August 08) I complained about 'use' being at a weird position and not at the same place as 'global' or 'static' where I expected it. Back then Dmitry asked me to provide a patch to check out the alternative. Now during the holidys I final

Re: [PHP-DEV] [RFC] Re: [PHP-DEV] __invoke() weirdness

2009-01-04 Thread Kenan R Sulayman
Hi Johannes, foo = "foo";$o->foo(); //Example 1 $o->bar = function(){}; $o->bar(); //Example 2 ?> The example 1 must not work, because PHP tries to call $o->foo() as a function, but not $o->foo as description for the function. To make example 2 working, the declaration has to be cha

Re: [PHP-DEV] [RFC] Re: [PHP-DEV] __invoke() weirdness

2009-01-04 Thread Johannes Schlüter
Hi, On Sat, 2009-01-03 at 15:47 +0100, Marcus Boerger wrote: > > I'd say it would be good to concentrate on making 5.3 stable and then > > see how new features are accepted. If users really demand such a > > functionality, when using closures for "real life" development, we can > > still add it, b

Re: [PHP-DEV] Closures serialization

2009-01-04 Thread Johannes Schlüter
On Sat, 2009-01-03 at 14:12 +0100, Marcin Kurzyna wrote: > as you said it's saving the zend_function member that is tricky. i > thought i'd go with saving function string and recompiling it as you > suggested (i don't want to mess with APC although i find the idea of > opcode serialization much

Re: [PHP-DEV] php://input in CLI sapi

2009-01-04 Thread Alexey Zakhlestin
On Sat, Jan 3, 2009 at 5:19 PM, Timm Friebe wrote: > Hi, > is there any reason php://input is not supported in CLI sapi? It would be > nice to test raw post data reading in unittests without having to run them > inside a web server sapi and it's only a five-line patch making php://input > read fro