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

2008-06-26 Thread Larry Garfield
On Thursday 26 June 2008 11:23:53 am Christian Seiler wrote: > Hi Dmitry, > > > I'm fine if you'll improve my patch (It's mainly yours :) > > I updated my closures RFC: http://wiki.php.net/rfc/closures > In my eyes, the following questions should be answered: > > * Do you want closures in PHP? >

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

2008-06-26 Thread Andi Gutmans
Hey Christian, Nice job! More below: > -Original Message- > From: Christian Seiler [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 26, 2008 9:24 AM > To: Dmitry Stogov > Cc: php-dev List; Andi Gutmans; Stas Malyshev > Subject: Re: [PHP-DEV] [PATCH] [RFC] Closures and lambda functions i

Re: [PHP-DEV] Drop ext/mhash and add an emulation layer in ext/hash (5.3+), call for help

2008-06-26 Thread Scott MacVicar
Pierre Joye wrote: On Mon, Jun 2, 2008 at 12:34 PM, Scott MacVicar <[EMAIL PROTECTED]> wrote: Pierre Joye wrote: On Mon, Jun 2, 2008 at 10:21 AM, Derick Rethans <[EMAIL PROTECTED]> wrote: On Mon, 2 Jun 2008, Pierre Joye wrote: While working on the windows ports, I asked Sara about the mhash

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

2008-06-26 Thread Christian Seiler
Hi! I see exactly one problem with the patch, which is that the above script shouldn't work without "use (&$i)". I find it counterintuitive that the creation of the lambda creates a copy of $i, but all invocations of $lambda use a reference to the same $i. For n calls to $lambda, there are only

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

2008-06-26 Thread Christian Seiler
Hi Marcus, I like the new ability to reference if wanted. But then I don't like references at all. As I said: Without reference support, you can't call it closures. Closures must per definition have the possibility to change the values of used variables in the parent scope - and the only sensi

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

2008-06-26 Thread Alexander Wagner
> * I added tests (Zend/tests/closures_*.phpt) that ensure the correct > behaviour of closures. I'd like to propose an additional test to ensure closures can all themselves: Expected output: 3 2 1 3 I see exactly one problem with the patch, which is that the above script shouldn't work wi

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

2008-06-26 Thread Marcus Boerger
Hello Sebastian, ok, even though I just wrote differently. It appears to me, after reading the rest of the thread, that I shouuld maybe give in and favor a 5.4 instead. marcus Wednesday, June 25, 2008, 10:42:50 AM, you wrote: > Lukas Kahwe Smith wrote: >> I am very sure we will see a 5.4. The

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

2008-06-26 Thread Marcus Boerger
Hello Christian, Thursday, June 26, 2008, 6:23:53 PM, you wrote: > Hi Dmitry, >> I'm fine if you'll improve my patch (It's mainly yours :) > I updated my closures RFC: http://wiki.php.net/rfc/closures > I have based my new version of the patch on yours (Dmitry), but I made > some changes to th

Re: [PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Steph Fox
No confusion. Clearly defined. No collision. ... except possibly between the eyes... We had this discussion ad infinitum in the past. Please, not again? - Steph -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Richard Quadling
2008/6/26 Stefan Priebsch <[EMAIL PROTECTED]>: > Hey all, > > honestly, it is not my intention to raise a new flamewar, but aren't most > of these ambiguity problems we talk about due to the fact that :: is used as > the namespace separator? > > Regards, > > Stefan > I think so. Considering this

Re: [PHP-DEV] Using Network functions.

2008-06-26 Thread Christian Seiler
Hi! 2. What does streams has to do with this networking? Can it be done using streams? Yes, it can. Take the following simple, incomplete example without much error handling as a starting point: // in the header #include "php_streams.h" // PHP function: PHP_FUNCTION(simplehttp_fetch) { php

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

2008-06-26 Thread James Dempster
I would agree, they seem to cause more problems and pollution than it would solve. I like the idea behind namespaces but what I've seen of the current implementations I would rather do without. Unfortunately I don't have any ideas or solutions to the problems. /James Dempster On Thu, Jun 26, 2008

Re: [PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Stefan Priebsch
Hey all, honestly, it is not my intention to raise a new flamewar, but aren't most of these ambiguity problems we talk about due to the fact that :: is used as the namespace separator? Regards, Stefan -- >e-novative> - We make IT work for you. e-novative GmbH - HR: Amtsgericht München HR

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

2008-06-26 Thread Christian Seiler
Hi Dmitry, I'm fine if you'll improve my patch (It's mainly yours :) I updated my closures RFC: http://wiki.php.net/rfc/closures I have based my new version of the patch on yours (Dmitry), but I made some changes to that: * Objects instead of resources are used, two new files zend_closur

Re: [PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Stan Vassilev | FM
How bad would it be to say that namespacing can only apply to classes and not normal functions? Lame, very lame. It would make them unusable for many distributed projects that are not 100% OOP. Wordpress comes to mind. My own Phorum as well. I agree, namespaces need to work for all defi

Re: [PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Brian Moon
How bad would it be to say that namespacing can only apply to classes and not normal functions? Lame, very lame. It would make them unusable for many distributed projects that are not 100% OOP. Wordpress comes to mind. My own Phorum as well. It was my understanding that one of the primar

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

2008-06-26 Thread David Coallier
>> >> The attached patch may also help both core and PECL extensions, emiting a >> deprecation compile warning when those functions are used. A bit late to answer but very good idea :) -- Slan, David -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.

Re: [PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Richard Quadling
2008/6/26 Hartmut Holzgraefe <[EMAIL PROTECTED]>: > Richard Quadling wrote: > > How bad would it be to say that namespacing can only apply to classes and >> not normal functions? >> > > i don't see namespacing as an OO only feature, IMHO it is a perfectly > valid and useful thing for pure procedu

Re: [PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Hartmut Holzgraefe
Richard Quadling wrote: How bad would it be to say that namespacing can only apply to classes and not normal functions? i don't see namespacing as an OO only feature, IMHO it is a perfectly valid and useful thing for pure procedural code, too not having namespacing for procedural functions wo

[PHP-DEV] How bad would it be to say/enforce that namespacing can only apply to classes and not normal functions?

2008-06-26 Thread Richard Quadling
2008/6/26 Derick Rethans <[EMAIL PROTECTED]>: > On Tue, 24 Jun 2008, Rasmus Lerdorf wrote: > > > Derick Rethans wrote: > > > On Tue, 24 Jun 2008, Alexey Zakhlestin wrote: > > > > > > > it won't be a serious 'wtf', as on the top of the file, there > > > > would be some kind of use MySuperLibrary::D

Re: [PHP-DEV] Re: Using Network functions.

2008-06-26 Thread Cristian Rodríguez
Mangol Smith escribió: Hey guys, someone suggested me to have a look at libcURL. I did, but its very complex. All I needed is lowlevel/network wrappers. like emalloc() & pemalloc() as wrapper on malloc(). There might be some wrappers (platform independent & used in php source code) which I can

[PHP-DEV] [PATCH] ODBC_Pconnect should not Commit/Rollback database transactions of previous data

2008-06-26 Thread Bijl, Gomar
Hi We have a problem with the (ODBC) persistent database connection. We have found that every PHP-session, using the same dsn, user and password, are getting the same persistent connection by a reasonable chance. Also meaning that if a database transaction was not finished, other PHP-session can d

Re: [PHP-DEV] Re: Using Network functions.

2008-06-26 Thread Mangol Smith
> Are you sure you even need to write your own extension? If you just want to > do > HTTP requests, then curl or HTTP extension should be sufficient. Nope, I'm developing an extension. In which I require this functionality. Its not the entire purpose of my extension. Just a part of the functional

Re: [PHP-DEV] Re: Using Network functions.

2008-06-26 Thread Paweł Stradomski
W liście Mangol Smith z dnia czwartek 26 czerwca 2008: > But, doesn't this make my extension depend on Curl or any PEAR extension > you are talking about? That is what I wan't to avoid. > Are you sure you even need to write your own extension? If you just want to do HTTP requests, then curl or H

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

2008-06-26 Thread Gwynne Raskind
On Jun 26, 2008, at 4:06 AM, Lukas Kahwe Smith wrote: Now, upon execution of the code containing the closure, the new opcode just copies the zend_function structure into a copy, registers that copy as a resource and returns that resource. As soon as the resource is garbage collected (or expli

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

2008-06-26 Thread Lukas Kahwe Smith
On 18.06.2008, at 14:17, Christian Seiler wrote: Now, upon execution of the code containing the closure, the new opcode just copies the zend_function structure into a copy, registers that copy as a resource and returns that resource. As soon as the resource is garbage collected (or explicitl

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

2008-06-26 Thread Derick Rethans
On Tue, 24 Jun 2008, Rasmus Lerdorf wrote: > Derick Rethans wrote: > > On Tue, 24 Jun 2008, Alexey Zakhlestin wrote: > > > > > it won't be a serious 'wtf', as on the top of the file, there > > > would be some kind of use MySuperLibrary::DateTime; > > > > I know, but 400 lines down in the code y