Re: [PHP-DEV] LSB forward_static_call()

2008-06-20 Thread Stanislav Malyshev
Hi! So, I really would like to revert that foward_static_call stuff and implement the parent:: patch instead, while it's still possible. thoughts? Didn't we discuss that already? Adding magic to parent:: is not a good idea, it's very basic language construct and should work simple. LSB is an

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread troels knak-nielsen
On Fri, Jun 20, 2008 at 9:36 PM, Markus Fischer <[EMAIL PROTECTED]> wrote: > Since some raised issues with the word "lexical", what do people think to > just re-use the (afaik deprecated) "var" keyword, so we won't need a new > keyword in the chain. What exactly is the problem with "lexical"? I fi

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Christian Seiler
Hi! Since some raised issues with the word "lexical", what do people think to just re-use the (afaik deprecated) "var" keyword, so we won't need a new keyword in the chain. That would be quite confusing IMHO, since JavaScript uses 'var' for the exact opposite - to declare variables that are l

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Markus Fischer
Since some raised issues with the word "lexical", what do people think to just re-use the (afaik deprecated) "var" keyword, so we won't need a new keyword in the chain. cheers, - Markus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Larry Garfield
On Fri, 20 Jun 2008 12:00:07 -0400, Robert Cummings <[EMAIL PROTECTED]> wrote: >> function foo($a, $b, &$c) global ($d, &$e) { >> // ... >> } >> >> $myfunc = lambda($a, $b, &$c) lexical ($d, &$e) { >> // ... >> } >> >> That puts all the information in the declaration line with parallel > synt

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-06-20 Thread Sam Barrow
On Thu, 2008-06-19 at 20:07 +0200, Timm Friebe wrote: > Hi, > > >> I like this generally, but cannot live with the BC issues raised. > >> Introducing all type names as keywords will make "class Object", "class > >> Integer" and so on give a syntax error. > > > > That's actually not true, the pa

Re: [PHP-DEV] cleaning up the functions - any volunteers?

2008-06-20 Thread Stanislav Malyshev
Hi! Can you confirm you're not already working on this? Tony told me on IRC you were doing something. I was just about to commit Yes, I'm not working on ext/standard. I was doing Zend engine, but that is done. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend

Re: [PHP-DEV] cleaning up the functions - any volunteers?

2008-06-20 Thread Olivier Hill
Stan, Can you confirm you're not already working on this? Tony told me on IRC you were doing something. I was just about to commit ext/standard/var.c & tests. David and I are going to go through ext/standard/* Thanks Olivier On Fri, Jun 20, 2008 at 12:45 PM, David Coallier <[EMAIL PROTECTED]> wr

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Stanislav Malyshev
Hi! As one of the Haskell list denizens commented, is there a potential for memory leakage if lambdas implicitly import $this when defined within an object Not really leakage (if refcounts done right) but lifetimes extending beyond what is expected - i.e. if some instance of closure generate

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Alexander Wagner
> I think allowing globals/lexicals to be passed by value doesn't make > much sense, you could just use a regular parameter for that. No, that is highly inconvenient when you're doing actual functional programming with higher order functions and everything. $i = 1; $incrementor = lambda ($x) lex

Re: [PHP-DEV] cleaning up the functions - any volunteers?

2008-06-20 Thread David Coallier
2008/6/20 Olivier Hill <[EMAIL PROTECTED]>: > Want some help D? :) > > Olivier > > On Fri, Jun 20, 2008 at 11:18 AM, David Coallier <[EMAIL PROTECTED]> wrote: > > I'll take a few > Yep, after speaking with felipe, we (you and I) have standard/ -- Slan, David

[PHP-DEV] Re: simple solution to another namespace conundrum?

2008-06-20 Thread Gregory Beaver
Dmitry Stogov wrote: > Looks fine, but probably we should emit error only if class declared in > the same source file. > > Thanks. Dmitry. > Great, didn't realize how easy this would be. Attached patch does this, but requires another test: 067.php.inc: --TEST-- 067: Name ambiguity (import n

Re: [PHP-DEV] LSB forward_static_call()

2008-06-20 Thread Alexey Zakhlestin
On 6/20/08, Etienne Kneuss <[EMAIL PROTECTED]> wrote: > To sum up key points about each possibilities: > > 1) forward_static_call > + no need to affect the engine > - slow, painful > > 2) parent:: carries the info while ParentClassName:: doesn't > + convenient > + no functionnality lost >

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Robert Cummings
On Fri, 2008-06-20 at 10:50 -0500, Larry Garfield wrote: > On Fri, 20 Jun 2008 16:33:08 +0200, Alexander Wagner <[EMAIL PROTECTED]> > wrote: > > On Friday 20 June 2008, Larry Garfield wrote: > >> > function ($x, $y) use ($a, $b, &$c) {}; > >> > >> I am not sure if "use" is the clearest word to use

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Rodrigo Saboya
Larry Garfield escreveu: > Totally silly idea: function foo($a, $b, &$c) global ($d, &$e) { // ... } $myfunc = lambda($a, $b, &$c) lexical ($d, &$e) { // ... } That puts all the information in the declaration line with parallel syntax and semantics, and would even allow both by-val and b

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Alexander Wagner
On Friday 20 June 2008, Chris Stockton wrote: > No one at all thinks: > function foo($x, $y) use $a, $b, $c { > } > > Looks awkward and a little out of place It certainly is new and different in PHP, but I don't see a reason why this should be hard to get used to. Also, it works for Java exceptio

[PHP-DEV] Re: simple solution to another namespace conundrum?

2008-06-20 Thread Dmitry Stogov
Looks fine, but probably we should emit error only if class declared in the same source file. Thanks. Dmitry. Gregory Beaver wrote: > Hi, > > You probably have seen Derick's blog post > http://www.derickrethans.nl/namespaces_in_php.php > > It occurred to me today that there might be a simple, e

[PHP-DEV] LSB forward_static_call()

2008-06-20 Thread Etienne Kneuss
Hi, Sorry to bring that up again! Quick summary for people that didn't follow it: LSB was implemented, and it was decided that "explicit calls" ( ClassName::method() ) wouldn't pass the caller info if no fallbacks occured. Some people that were looking forward to having LSB were disappointed as i

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Larry Garfield
On Fri, 20 Jun 2008 16:33:08 +0200, Alexander Wagner <[EMAIL PROTECTED]> wrote: > On Friday 20 June 2008, Larry Garfield wrote: >> > function ($x, $y) use ($a, $b, &$c) {}; >> >> I am not sure if "use" is the clearest word to use there (wouldn't > lexical >> there make more sense?) > > I agree. "

Re: [PHP-DEV] Algorithm Optimizations - string search

2008-06-20 Thread Michal Dziemianko
Hello I am doing benchmarking all the time - not only of the patches, but also some other code that might be useful later. Here are some values for the STRRPOS patch: http://212.85.117.53/gsoc/ index.php?option=com_content&view=article&id=48:strrpos-patch- proposal&catid=36:patches&Itemid=56

[PHP-DEV] simple solution to another namespace conundrum?

2008-06-20 Thread Gregory Beaver
Hi, You probably have seen Derick's blog post http://www.derickrethans.nl/namespaces_in_php.php It occurred to me today that there might be a simple, elegant solution to this problem. First, let's imagine someone writes this code: Now, in PHP 5.4, we introduce an internal class "Closure" and

Re: [PHP-DEV] cleaning up the functions - any volunteers?

2008-06-20 Thread Olivier Hill
Want some help D? :) Olivier On Fri, Jun 20, 2008 at 11:18 AM, David Coallier <[EMAIL PROTECTED]> wrote: > I'll take a few -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] cleaning up the functions - any volunteers?

2008-06-20 Thread David Coallier
I'll take a few 2008/6/20 Stanislav Malyshev <[EMAIL PROTECTED]>: > Hi! > > While we nearing the release of 5.3 (hopefully?), there are many functions > in the PHP code which still use old parameter parsing API > (zend_get_parameters_ex) instead of the new one (zend_parse_parameters). > > I have

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Christian Seiler
Hi, I would be fine with requiring an explicit declaration of $this if it helped avoid memory leaks. I would propose to always require explicit declaration of $this, even if there is no memory-leak problem. This would make it easier to distinguish plain lambdas from closures and would preve

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Chris Stockton
Hello, No one at all thinks: function foo($x, $y) use $a, $b, $c { } Looks awkward and a little out of place when compared to: vs function foo($x, $y) { lexical $a, $b, $c; } Although the fact we have to import variables from the parent scope kinda stinks and is not typical in closer imple

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Alexander Wagner
On Friday 20 June 2008, Larry Garfield wrote: > > function ($x, $y) use ($a, $b, &$c) {}; > > I am not sure if "use" is the clearest word to use there (wouldn't lexical > there make more sense?) I agree. "use" for both namespaces and closures may not be a good idea. Otherwise +1 to this syntax for

Re: [PHP-DEV] Overloading

2008-06-20 Thread Marcus Boerger
Hello Mark, we discussed overloading a hell lot of times an dthe conclusionj always and every single time has been NO. It would mean a large slowdown for every single PHP application out there and it is not really that much halpful. In fact it makes code less readable and maintainable so it oppo

Re: [PHP-DEV] Backports for run-tests and win32 build system

2008-06-20 Thread Steph Fox
A list would help :-) Sure, I was just asking 'in principle'. It'll probably be tomorrow before I have time to actually do anything about it :) - Steph -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] Backports for run-tests and win32 build system

2008-06-20 Thread Pierre Joye
On Fri, Jun 20, 2008 at 4:07 PM, Steph Fox <[EMAIL PROTECTED]> wrote: > > Hi Ilia, > > Do you have any objection to my backporting some changes to the 5_2 branch > that don't affect PHP itself? > > These would include: > > Windows-specific > > configure.bat > configure --disable_al

[PHP-DEV] Backports for run-tests and win32 build system

2008-06-20 Thread Steph Fox
Hi Ilia, Do you have any objection to my backporting some changes to the 5_2 branch that don't affect PHP itself? These would include: Windows-specific configure.bat configure --disable_all fix nmake clean-all Non-specific run-tests.php -x run-tests.php --set-t

Re: [PHP-DEV] interesting update on phar performance

2008-06-20 Thread Ilia Alshanetsky
Greg, Congrats, those are rather impressive results. On 20-Jun-08, at 3:12 AM, Gregory Beaver wrote: Hi all, I decided to run my standard phpMyAdmin test without APC enabled and got startling results from siege: Date & Time, Trans, Elap Time, Data Trans, Resp Time, Trans Rate,

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Alexey Zakhlestin
On 6/20/08, Dmitry Stogov <[EMAIL PROTECTED]> wrote: > It is possible to do it, but I don't see any reason to invest time into > it. PHP scripts hardly ever use nested functions, and you always can > access global variables through "global" or $GLOBALS. I don't see, why > do we need another way

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Dmitry Stogov
It is possible to do it, but I don't see any reason to invest time into it. PHP scripts hardly ever use nested functions, and you always can access global variables through "global" or $GLOBALS. I don't see, why do we need another way to do the same. Thanks. Dmitry. Lars Strojny wrote: > Hi Dmitr

RE: [PHP-DEV] Overloading

2008-06-20 Thread Tinsley, Mark
I only could find two from 2005. http://news.php.net/php.internals/17491 http://news.php.net/php.internals/14558 It doesn't look like much discussion. I'm new to that web interface; not sure if it will show the thread. Why don't we discuss adding this to the PHP6 release? I see it as a very helpf

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Lars Strojny
Hi Dmitry, Am Freitag, den 20.06.2008, 16:19 +0400 schrieb Dmitry Stogov: > No it won't. While I don't want to use it, it might be really confusing to our users that it works different to closures (because the declaration of functions and closures looks similar). Are there any internal limitation

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Larry Garfield
On Friday 20 June 2008, Lenar Lõhmus wrote: > Hi, > > Rodrigo Saboya wrote: > >> function ($x, $y) ($a, $b, $c) {}; > > > > This looks better > > > >> function ($x, $y) [$a, $b, $c] {}; > > I think this looks even better: > > function ($x, $y) use ($a, $b, &$c) {}; > > (one could use this synt

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Dmitry Stogov
No it won't. Dmitry. Lars Strojny wrote: > Hi Dmitry, hi Christian, > > Am Freitag, den 20.06.2008, 15:12 +0400 schrieb Dmitry Stogov: >> $func = function ($x, $y) use $a, $b, $c { >> } > > Will lexical scoping work with normal ("named") functions too? > > function foo($x, $y) use $a, $b, $c {

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Lars Strojny
Hi Dmitry, hi Christian, Am Freitag, den 20.06.2008, 15:12 +0400 schrieb Dmitry Stogov: > > $func = function ($x, $y) use $a, $b, $c { > } Will lexical scoping work with normal ("named") functions too? function foo($x, $y) use $a, $b, $c { } cu, Lars signature.asc Description: Dies ist ein d

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Dmitry Stogov
Hi Christian, I'm fine with your suggestion for lexical variables syntax, but I don't know if we really need brackets around them. For now I changed syntax in the following way. $func = function ($x, $y) use $a, $b, $c { } According to segfault, I added a check that emits fatal error. I don't l

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Kalle Sommer Nielsen
Hey I must say that the lexical keywords makes alot more sense to me which keeps the syntax readable without making it too cryptic for the unexperinced or new developer to php. I think introducing both the lexical keyword and as Andi proposed a $LEXICAL as a to the global / $GLOBALS. Both wa

Re: [PHP-DEV] Algorithm Optimizations - string search

2008-06-20 Thread Nuno Lopes
Hi, Both patches seem ok to me. Please ask for a CVS account and prepare yourself to commit (when your mentor says so) :) In the second patch maybe you could use zend_memrchr() as well, but you should get the same results. Also I think that bundling the backwards KMP would be a nice addition.

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Marcus Boerger
Hello Stanislav, Wednesday, June 18, 2008, 5:00:09 PM, you wrote: > Hi! >> First: My patch is quite non-intrusive, it only adds things in a few >> places (new opcode, a few checks). If you only look at the non-generated > I think it falls into "famous last words" category. While I did not have

Re: [PHP-DEV] Algorithm Optimizations - string search

2008-06-20 Thread Michal Dziemianko
Hello, Here goes first diff - to keep it simple and avoid confusion I will post them one-by-one after the previous is accepted/rejected. Optimization of STRRPOS/STRRIPOS for PHP_5_3. 2 things are changed: * implementation of search loop from theta(NM) to o(N), omega(NM) - it is now the same

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Marcus Boerger
Hello Andi, Thursday, June 19, 2008, 8:44:07 AM, you wrote: > See below: >> -Original Message- >> From: Christian Seiler [mailto:[EMAIL PROTECTED] >> Sent: Wednesday, June 18, 2008 1:14 PM >> To: php-dev List >> Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP >>

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Marcus Boerger
Hello Andi, Wednesday, June 18, 2008, 8:01:34 AM, you wrote: > Hi Christian, > This is a very nice piece of work. Definitely addresses a lot of the issues > we have raised in the past. > I would like to see such a solution make its way into PHP (see below re: > timing). > There are some thing

Re: [PHP-DEV] [RFC] Strict type hints (parameter and return value)

2008-06-20 Thread Guillaume Rossolini
Hi, >From a user perspective, I agree that this would probably be the most useful behaviour of all. "Type hint" would then mean*: Hint at what type the variable should have. If possible, convert it to the target type; if it is not even compatible, throw an error*. Regards, Guillaume Rossolini

Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions in PHP

2008-06-20 Thread Lenar Lõhmus
Hi, Rodrigo Saboya wrote: >> >> function ($x, $y) ($a, $b, $c) {}; > > This looks better > >> function ($x, $y) [$a, $b, $c] {}; I think this looks even better: function ($x, $y) use ($a, $b, &$c) {}; (one could use this syntax even for traditional functions to use variable copies/references f

[PHP-DEV] interesting update on phar performance

2008-06-20 Thread Gregory Beaver
Hi all, I decided to run my standard phpMyAdmin test without APC enabled and got startling results from siege: Date & Time, Trans, Elap Time, Data Trans, Resp Time, Trans Rate, Throughput, Concurrent,OKAY, Failed 2008-06-20 02:02:35,915, 60.01, 1, 0.98,