Re: [PHP-DEV] Can't vote yet, as RFC has "options" (Was: Re: [PHP-DEV] [VOTE] release process RFC)

2011-06-20 Thread Sebastian Bergmann
Am 20.06.2011 15:30, schrieb Derick Rethans: > I am not generally against this RFC, but this point needs to be > discussed first IMO. As having 5 active branches at the same time for > the "multiple major releases" option is *not* workable. I agree. -- Sebastian BergmannCo

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Rasmus Lerdorf
On 06/20/2011 08:09 PM, Felipe Pena wrote: > I'm ok with this, I just think it's ugly to repeat the token name in > the definition in the .y file. :P > > %token T_LNUMBER "'number' (T_LNUMBER)" > %token T_STRING "'identifier' (T_STRING)" Why 'identifier' and not 'string' or 'string-literal' ther

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Felipe Pena
2011/6/20 Derick Rethans > > On Mon, 20 Jun 2011, Felipe Pena wrote: > > > 2011/6/20 Etienne Kneuss > > > > > > I'd love to see the proposal from Felipe about the improved parse > > > errors in that list. I believe that the patch was ready or almost > > > ready? I can't find the RFC though, but m

Re: [PHP-DEV] [PATCH] unregister_shutdown_function()

2011-06-20 Thread David Muir
On 21/06/11 07:41, Arpad Ray wrote: > I also think once that functionality is there the next request will be get_registered_shutdown_functions() or something along the lines. >>> I don't see of what use that could be. >> Completeness? "Has that stupid shutdown func been

Re: [PHP-DEV] [RFC] Object oriented session handlers

2011-06-20 Thread Arpad Ray
On Mon, Jun 20, 2011 at 10:37 AM, Richard Quadling wrote: > On 20 June 2011 01:39, Arpad Ray wrote: >> On Mon, Jun 6, 2011 at 5:31 PM, Richard Quadling wrote: >>> Not an internals expert, but I do have a question. >>> >>> When would the session handler object be destroyed? >>> >>> If sessions ar

Re: [PHP-DEV] [PATCH] unregister_shutdown_function()

2011-06-20 Thread Arpad Ray
2011/6/20 Johannes Schlüter : > > (any reason you sent this privately?) Nope, must have hit the wrong button ;) back to the list now. > > On Mon, 20 Jun 2011 18:38:50 +0100, Arpad Ray wrote: >> 2011/6/20 Johannes Schlüter : >>> Why do you register a shutdown function if you want to remove it aga

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Johannes Schlüter
On Mon, 20 Jun 2011 18:27:48 +0200, Robert Eisele wrote: > 2011/6/20 Johannes Schlüter >> Yes. So having this in the current form accepted means that >> >>$a[-1]; >> >> can have two meanings: >> >>1) Get the last item (byte in a string) >>2) Get item `-1` (in an array) >> > > Yes, s

Re: [PHP-DEV] Re: foreach() for strings

2011-06-20 Thread Johannes Schlüter
On Mon, 2011-06-20 at 20:38 +0200, Robert Eisele wrote: > I really like the ideas shared here. It's a thing of consideration that > array-functions should also work with strings. Maybe this would be the way > to go, but I'm more excited about the OOP implementation of TextIterator and > ByteIterato

Re: [PHP-DEV] Re: foreach() for strings

2011-06-20 Thread Tomas Kuliavas
2011.06.20 21:38 Robert Eisele rašė: > I really like the ideas shared here. It's a thing of consideration that > array-functions should also work with strings. Maybe this would be the way > to go, but I'm more excited about the OOP implementation of TextIterator > and > ByteIterator, which solves t

RE: [PHP-DEV] Re: foreach() for strings

2011-06-20 Thread John Crenshaw
> -Original Message- > From: Anthony Ferrara [mailto:ircmax...@gmail.com] > > > text_to_array($s) == str_split($s, 1) > > No, because str_split always splits into 1 byte chunks. text_to_array > would take the character set into account (or that's where the utility > in it would be)...

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Stas Malyshev
Hi! On 6/20/11 12:29 PM, Christopher Jones wrote: If messages are changing, can we feasibly strip the Bison "syntax error, " component? The "Command line code" component is arguably useless too. Or at least it could be lower cased to "command line", though changing this in php_cli.c may have a

[PHP-DEV] REMINDER: Participation Requested: Survey about Open-Source Software Development

2011-06-20 Thread Jeffrey Carver
Hi, Apologies for any inconvenience and thank you to those who have already completed the survey. We will keep the survey open for another couple of weeks. But, we do hope you will consider responding to the email request below (sent 2 weeks ago). Thanks, Dr. Jeffrey Carver Assistant Professor U

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Christopher Jones
On 06/20/2011 08:50 AM, Derick Rethans wrote: On Mon, 20 Jun 2011, Felipe Pena wrote: 2011/6/20 Etienne Kneuss I'd love to see the proposal from Felipe about the improved parse errors in that list. I believe that the patch was ready or almost ready? I can't find the RFC though, but maybe th

Re: [PHP-DEV] Re: foreach() for strings

2011-06-20 Thread Robert Eisele
I really like the ideas shared here. It's a thing of consideration that array-functions should also work with strings. Maybe this would be the way to go, but I'm more excited about the OOP implementation of TextIterator and ByteIterator, which solves the whole problem at once (and is easier to impl

[PHP-DEV] Re: [PATCH] Notice on array to string convertion

2011-06-20 Thread Patrick ALLAERT
2011/6/2 Patrick ALLAERT : > Hi, > > I would like to introduce an E_NOTICE when an array is silently > converted to a string. > This isn't very useful as it constantly produces the following string: > "Array" and in most of the case, this is a sign of an error. > > Let me know about your feelings.

[PHP-DEV] Re: [VOTE] release process RFC

2011-06-20 Thread Bruno CHALOPIN
Le Mon, 20 Jun 2011 14:59:51 +0200, Pierre Joye a écrit : > Hi Internals, > > We have been working on getting this rfc on how to have clear and > transparent releases process, release cycles and how and which features > get into a release. The RFC is finally ready for the votes. > Therefore we ca

Re: [PHP-DEV] PHP patches

2011-06-20 Thread Robert Eisele
Thanks, Johannes! :) It works. 2011/6/20 Johannes Schlüter > On Mon, 2011-06-20 at 07:11 -0700, Philip Olson wrote: > > On Jun 20, 2011, at 7:01 AM, Robert Eisele wrote: > > > > > Could I please get an wiki account? I've posted some stuff on the > mailing > > > list, but I think it would be bett

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Stas Malyshev
Hi! On 6/20/11 10:56 AM, Robert Eisele wrote: Stas, Why should it be a BC break? Empty strings are not considered, in any mode or what feature of strtr() did I miss? Because now strtr("passion", "os", "") returns different result. Combined with the fact that you already can do it with array sy

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Robert Eisele
Stas, Why should it be a BC break? Empty strings are not considered, in any mode or what feature of strtr() did I miss? Gustavo, does you not constradict yourself, when you say it's already available in the one mode and in the other it shouldn't be? What about the intuitive and nosy developers tha

Re: [PHP-DEV] Re: foreach() for strings

2011-06-20 Thread Todd Ruth
On Mon, 2011-06-20 at 10:06 -0700, Stas Malyshev wrote: > Hi! > > On 6/20/11 9:57 AM, Todd Ruth wrote: > > Iterators are nice. Having a "text_string_to_array" function > > would also be fine. For example: > > > > $s = 'hello'; > > foreach (text_string_to_array($s) as $x) { > > var_dump($x);

Re: [PHP-DEV] Re: foreach() for strings

2011-06-20 Thread Anthony Ferrara
> text_to_array($s) == str_split($s, 1) No, because str_split always splits into 1 byte chunks. text_to_array would take the character set into account (or that's where the utility in it would be)... On Mon, Jun 20, 2011 at 1:06 PM, Stas Malyshev wrote: > Hi! > > On 6/20/11 9:57 AM, Todd Ruth

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Robert Eisele
2011/6/20 Stas Malyshev > Hi! > > Negative string offsets is a wish and also an implementation of my running >> PHP version for long. It operates in the same fashion like substr() with >> negative offsets, but avoids the function call and is much smarter if one >> single character has to be extr

Re: [PHP-DEV] PHP patches

2011-06-20 Thread Johannes Schlüter
On Mon, 2011-06-20 at 07:11 -0700, Philip Olson wrote: > On Jun 20, 2011, at 7:01 AM, Robert Eisele wrote: > > > Could I please get an wiki account? I've posted some stuff on the mailing > > list, but I think it would be better to document all this stuff on a central > > place, also with regard to

Re: [PHP-DEV] Standard constants as part of the lexer

2011-06-20 Thread Stas Malyshev
Hi! On 6/20/11 4:12 AM, Robert Eisele wrote: I think it depends on the experience of the developers. There are many - halfway ugly - "PHP optimization" tricks on the net. If these are used, the difference wouldn't that much. But constructs like for($i=0; $i If you're microoptimizing, you should

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Gustavo Lopes
Em Mon, 20 Jun 2011 12:32:30 +0100, Robert Eisele escreveu: $demise = strtr("passion", "os", ""); This is a very bad idea for several reasons: - strtr already does this with: $demise = strtr("passion", array("o" => "", "s" => "")); - it's a BC break - adds a *third* operation mode to st

Re: [PHP-DEV] Re: foreach() for strings

2011-06-20 Thread Stas Malyshev
Hi! On 6/20/11 9:57 AM, Todd Ruth wrote: Iterators are nice. Having a "text_string_to_array" function would also be fine. For example: $s = 'hello'; foreach (text_string_to_array($s) as $x) { var_dump($x); } text_to_array($s) == str_split($s, 1) -- Stanislav Malyshev, Software Archit

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Stas Malyshev
Hi! Here is the next one. I think it's quite intuitive to use strtr() to remove single characters of a string, too, instead of using many str_replace($str, $chr, ""). I'd glad to see this change also in 5.4. This is a BC break, if I understand it correctly, so I don't think it is a good idea

[PHP-DEV] Re: foreach() for strings

2011-06-20 Thread Todd Ruth
Adding to John Crenshaw's list of reasons not to implicitly treat strings as arrays in foreach loops... Please keep in mind the following valid code: $s = 'hello'; foreach ((array)$s as $x) { var_dump($x); } The result is: string(5) "hello" That behavior can be handy. Hopefully, a BC break

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Stas Malyshev
Hi! I'd love to see the proposal from Felipe about the improved parse errors in that list. I believe that the patch was ready or almost ready? I can't find the RFC though, but maybe the RFC never existed... Thanks, missed it. I think based on the discussion and wide acceptance we could put it

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Stas Malyshev
Hi! On 6/20/11 4:39 AM, Derick Rethans wrote: On Thu, 16 Jun 2011, Stas Malyshev wrote: 3. Add E_STRICT to E_ALL. Nuff said. We did it in 6.0/unicode branch but didn't backport it. Not sure about that. Can't we just tell people to use -1 ? Well, yes, but a) we had it in 6.0 and b) ALL not

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Stas Malyshev
Hi! On 6/20/11 9:15 AM, John Crenshaw wrote: From: Ilia Alshanetsky [mailto:i...@prohost.org] As long as it works on a premise that a "string" is a byte array and each element represents 1 byte, +1 from me. Code written on this premise is almost always bug central when people finally get arou

[PHP-DEV] 5.4 alpha

2011-06-20 Thread Stas Malyshev
Hi! Since we've got voting on the process RFCs finally going on, after much deliberation we've decided it'd be best to let the votes finish before the first official 5.4 release. Thus, we decided to postpone 5.4 alpha 1 until June 28th (next Tuesday). The updated schedule is at https://wiki.p

[PHP-DEV] Annotations / Interceptors

2011-06-20 Thread Jeremy Hahn
Hi, I am new to the list and just got done doing a search through the archives to try and get an idea on where things stand in regards to annotation support in PHP. Although I did find some interesting debates, I was not really able to conclude one way or the other what the plan is. I've not

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Stas Malyshev
Hi! Negative string offsets is a wish and also an implementation of my running PHP version for long. It operates in the same fashion like substr() with negative offsets, but avoids the function call and is much smarter if one single character has to be extracted: $str = "Hallo"; Sounds OK, bu

RE: [PHP-DEV] foreach() for strings

2011-06-20 Thread John Crenshaw
> From: Ilia Alshanetsky [mailto:i...@prohost.org] > > As long as it works on a premise that a "string" is a byte array and > each element represents 1 byte, +1 from me. Code written on this premise is almost always bug central when people finally get around to realizing why they really do need

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Stas Malyshev
Hi! foreach() has many functions, looping over arrays, objects and implementing the iterator interface. I think it's also quite intuitive to use foreach() for strings, too. I'm not sure how you'd implement such thing, but then I think things like next(), end(), etc. should work too... -- Sta

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Robert Eisele
2011/6/20 Johannes Schlüter > On Mon, 2011-06-20 at 17:49 +0200, Robert Eisele wrote: > > I would not consider this for arrays and objects, too. If we had real > > arrays, this would make sense but they are HT's and therewith it can also > be > > explained that -1 is an element and not the end of

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Johannes Schlüter
On Mon, 2011-06-20 at 17:49 +0200, Robert Eisele wrote: > I would not consider this for arrays and objects, too. If we had real > arrays, this would make sense but they are HT's and therewith it can also be > explained that -1 is an element and not the end of the chained list behind > the HT. Yes.

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Felipe Pena wrote: > 2011/6/20 Etienne Kneuss > > > > I'd love to see the proposal from Felipe about the improved parse > > errors in that list. I believe that the patch was ready or almost > > ready? I can't find the RFC though, but maybe the RFC never existed... > > > > ht

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Robert Eisele
I would not consider this for arrays and objects, too. If we had real arrays, this would make sense but they are HT's and therewith it can also be explained that -1 is an element and not the end of the chained list behind the HT. 2011/6/20 Johannes Schlüter > On Mon, 2011-06-20 at 16:31 +0200, E

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Felipe Pena
Hi, 2011/6/20 Etienne Kneuss > Hi, > > > On Fri, Jun 17, 2011 at 00:08, Stas Malyshev > wrote: > > Hi! > > > > Below is the list of the features proposed for inclusion in 5.4, as > outlined > > in https://wiki.php.net/todo/php54. Please read the TODO page and the > RFCs > > linked there for det

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Robert Eisele
I would push this out in two steps. First: Negative string offset and later range/slice support for objects and strings. Objects would need a new magic method, e.g. "__slice()",strings need a substr() like interface. I think both are accessed the same way, but way are different. The slice support i

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Johannes Schlüter
On Mon, 2011-06-20 at 16:31 +0200, Etienne Kneuss wrote: > >> Negative string offsets is a wish and also an implementation of my running > >> PHP version for long. It operates in the same fashion like substr() with > >> negative offsets, but avoids the function call and is much smarter if one > >>

Re: [PHP-DEV] Can't vote yet, as RFC has "options" (Was: Re: [PHP-DEV] [VOTE] release process RFC)

2011-06-20 Thread Johannes Schlüter
On Mon, 2011-06-20 at 09:28 -0500, dukeofgaming wrote: > On Mon, Jun 20, 2011 at 8:30 AM, Derick Rethans wrote: > > > > I am not generally against this RFC, but this point needs to be > > discussed first IMO. As having 5 active branches at the same time for > > the "multiple major releases" option

RE: [PHP-DEV] foreach() for strings

2011-06-20 Thread John Crenshaw
> -Original Message- > From: Lee davis [mailto:leedavi...@gmail.com] > Sent: Monday, June 20, 2011 9:12 AM > To: Robert Eisele > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] foreach() for strings > > I think this would be quite a useful feature, and am In favor of it. > However, I

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Ilia Alshanetsky
As long as it works on a premise that a "string" is a byte array and each element represents 1 byte, +1 from me. On Mon, Jun 20, 2011 at 7:27 AM, Robert Eisele wrote: > foreach() has many functions, looping over arrays, objects and implementing > the iterator interface. I think it's also quite in

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Ilia Alshanetsky
+1, seems useful. On Mon, Jun 20, 2011 at 8:02 AM, Robert Eisele wrote: > Negative string offsets is a wish and also an implementation of my running > PHP version for long. It operates in the same fashion like substr() with > negative offsets, but avoids the function call and is much smarter if o

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Jordi Boggiano
On 20.06.2011 14:02, Robert Eisele wrote: > Negative string offsets is a wish and also an implementation of my running > PHP version for long. It operates in the same fashion like substr() with > negative offsets, but avoids the function call and is much smarter if one > single character has to be

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Etienne Kneuss
Hi, On Fri, Jun 17, 2011 at 00:08, Stas Malyshev wrote: > Hi! > > Below is the list of the features proposed for inclusion in 5.4, as outlined > in https://wiki.php.net/todo/php54. Please read the TODO page and the RFCs > linked there for details. > This mail is not a vote call but rather descri

[PHP-DEV] SVN Account Request: crypt

2011-06-20 Thread Robert Eisele
Developing PHP runtime -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Etienne Kneuss
Hi, On Mon, Jun 20, 2011 at 14:05, Derick Rethans wrote: > On Mon, 20 Jun 2011, Robert Eisele wrote: > >> Negative string offsets is a wish and also an implementation of my running >> PHP version for long. It operates in the same fashion like substr() with >> negative offsets, but avoids the func

Re: [PHP-DEV] Can't vote yet, as RFC has "options" (Was: Re: [PHP-DEV] [VOTE] release process RFC)

2011-06-20 Thread dukeofgaming
On Mon, Jun 20, 2011 at 8:30 AM, Derick Rethans wrote: > > I am not generally against this RFC, but this point needs to be > discussed first IMO. As having 5 active branches at the same time for > the "multiple major releases" option is *not* workable. > If its because of the constant merges, it

Re: [PHP-DEV] Standard constants as part of the lexer

2011-06-20 Thread Etienne Kneuss
Hi, On Mon, Jun 20, 2011 at 13:12, Robert Eisele wrote: > 2011/6/20 Derick Rethans > >> On Mon, 20 Jun 2011, Robert Eisele wrote: >> >> > The constants true, false and null are used very often. Unfortunately, >> > every usage of either of these constants invokes a constant lookup. >> > There is

RE: [PHP-DEV] foreach() for strings

2011-06-20 Thread Jonathan Bond-Caron
On Mon Jun 20 09:11 AM, Lee davis wrote: > > Could we also use current(), next() and key() for iteration of strings? > > $string = 'string'; > while ($char = current($string)) > { > echo key($string) // Would output the offset position I assume 0,1,2 > etc?? > echo $char // outputs eac

Re: [PHP-DEV] PHP patches

2011-06-20 Thread Philip Olson
On Jun 20, 2011, at 7:01 AM, Robert Eisele wrote: > Could I please get an wiki account? I've posted some stuff on the mailing > list, but I think it would be better to document all this stuff on a central > place, also with regard to get these things rated. Greetings Robert, Considering the num

Re: [PHP-DEV] PHP patches

2011-06-20 Thread Robert Eisele
Could I please get an wiki account? I've posted some stuff on the mailing list, but I think it would be better to document all this stuff on a central place, also with regard to get these things rated. Robert 2011/6/17 Lester Caine > Sebastian Bergmann wrote: > >> [...] >>> >> >> Hello Robert,

[PHP-DEV] Can't vote yet, as RFC has "options" (Was: Re: [PHP-DEV] [VOTE] release process RFC)

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Pierre Joye wrote: > Hi Internals, > > We have been working on getting this rfc on how to have clear and > transparent releases process, release cycles and how and which > features get into a release. The RFC is finally ready for the votes. > Therefore we call for votes on th

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Lee davis
I think this would be quite a useful feature, and am In favor of it. However, I think caution should be taken when shifting array utilities out of their remit and allowing them to manipulate / traverse other data types. You may see the floodgates opening for more request to adapt array functions fo

[PHP-DEV] [VOTE] release process RFC

2011-06-20 Thread Pierre Joye
Hi Internals, We have been working on getting this rfc on how to have clear and transparent releases process, release cycles and how and which features get into a release. The RFC is finally ready for the votes. Therefore we call for votes on the release process RFC. The RFC can be found here: h

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Moriyoshi Koizumi
On Mon, Jun 20, 2011 at 8:39 PM, Derick Rethans wrote: >> 8. Cli web server. Built-in mini-HTTP server run directly from PHP binary. >> Assigned: Moriyoshi Koizumi > > I'd really like to see that one. I thought the patch was already > committed? Not yet. I'm gonna commit it in six hours or so if

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Pierre Joye
hi Robert, I would go with a RFC for that one, at least to document/cover edge cases to help the doc team to properly document this change if it gets approved. Thanks for your work so far! On Mon, Jun 20, 2011 at 1:27 PM, Robert Eisele wrote: > foreach() has many functions, looping over arrays,

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Pierre Joye
2011/6/20 Johannes Schlüter : > On Mon, 2011-06-20 at 13:27 +0200, Robert Eisele wrote: >> foreach() has many functions, looping over arrays, objects and implementing >> the iterator interface. I think it's also quite intuitive to use foreach() >> for strings, too. > > I would prefer a TextIterator

[PHP-DEV] [VOTE] voting rfc

2011-06-20 Thread David Soria Parra
Hi Internals, we have been working on getting an rfc together on how to deal with votes on rfcs. We aim to provide a simple mechaism for votes while still maintaining freedom on how to do votes and how to work on rfcs. I want to move forward on the voting and release RFCs, so we can move forward

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Felipe Pena
Hi, 2011/6/20 Robert Eisele > Negative string offsets is a wish and also an implementation of my running > PHP version for long. It operates in the same fashion like substr() with > negative offsets, but avoids the function call and is much smarter if one > single character has to be extracted:

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Robert Eisele wrote: > 2011/6/20 Derick Rethans > > > On Mon, 20 Jun 2011, Robert Eisele wrote: > > > > > foreach() has many functions, looping over arrays, objects and > > > implementing the iterator interface. I think it's also quite > > > intuitive to use foreach() for

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Johannes Schlüter wrote: > On Mon, 2011-06-20 at 13:27 +0200, Robert Eisele wrote: > > foreach() has many functions, looping over arrays, objects and implementing > > the iterator interface. I think it's also quite intuitive to use foreach() > > for strings, too. > > I would

Re: [PHP-DEV] Negative string offsets

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Robert Eisele wrote: > Negative string offsets is a wish and also an implementation of my running > PHP version for long. It operates in the same fashion like substr() with > negative offsets, but avoids the function call and is much smarter if one > single character has to be

[PHP-DEV] Negative string offsets

2011-06-20 Thread Robert Eisele
Negative string offsets is a wish and also an implementation of my running PHP version for long. It operates in the same fashion like substr() with negative offsets, but avoids the function call and is much smarter if one single character has to be extracted: $str = "Hallo"; $str[0] == "H" $str[-

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Johannes Schlüter
On Mon, 2011-06-20 at 13:27 +0200, Robert Eisele wrote: > foreach() has many functions, looping over arrays, objects and implementing > the iterator interface. I think it's also quite intuitive to use foreach() > for strings, too. I would prefer a TextIterator as we had in the old PHP 6 as this al

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Robert Eisele
2011/6/20 Derick Rethans > On Mon, 20 Jun 2011, Robert Eisele wrote: > > > foreach() has many functions, looping over arrays, objects and > implementing > > the iterator interface. I think it's also quite intuitive to use > foreach() > > for strings, too. > > > If you want to implement a parser i

Re: [PHP-DEV] foreach() for strings

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Robert Eisele wrote: > foreach() has many functions, looping over arrays, objects and implementing > the iterator interface. I think it's also quite intuitive to use foreach() > for strings, too. > If you want to implement a parser in PHP, you have to go the way with for + >

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Derick Rethans
On Thu, 16 Jun 2011, Stas Malyshev wrote: > 3. Add E_STRICT to E_ALL. Nuff said. We did it in 6.0/unicode branch but > didn't backport it. Not sure about that. Can't we just tell people to use -1 ? > 6. Array shortcuts. Make [ 'blah', 'blah' ] work same as array('blah', > 'blah'), etc. Does not

Re: [PHP-DEV] [PATCH] unregister_shutdown_function()

2011-06-20 Thread Johannes Schlüter
On Mon, 2011-06-20 at 07:36 +0100, Arpad Ray wrote: > This patch implements unregister_shutdown_function(), which removes a > function already registered with register_shutdown_function(). > > It resolves request #53702 (according to google, not sure if it's > still active) and I've thought it a c

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Robert Eisele
2011/6/20 Derick Rethans > On Mon, 20 Jun 2011, Robert Eisele wrote: > > > Here is the next one. > > > > I think it's quite intuitive to use strtr() to remove single characters > of a > > string, too, instead of using many str_replace($str, $chr, ""). I'd glad > to > > see this change also in 5.4

Re: [PHP-DEV] [RFC] 5.4 features for vote (long)

2011-06-20 Thread Moriyoshi Koizumi
Hi, I've been pretty busy for a while, and didn't well keep up to discussions regarding my built-in server patch. Is there any agreement on it yet? Moriyoshi On 2011/06/17, at 7:08, Stas Malyshev wrote: > Hi! > > Below is the list of the features proposed for inclusion in 5.4, as outlined >

[PHP-DEV] foreach() for strings

2011-06-20 Thread Robert Eisele
foreach() has many functions, looping over arrays, objects and implementing the iterator interface. I think it's also quite intuitive to use foreach() for strings, too. If you want to implement a parser in PHP, you have to go the way with for + strlen + substr() or $x[$i] to address one character

Re: [PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Robert Eisele wrote: > Here is the next one. > > I think it's quite intuitive to use strtr() to remove single characters of a > string, too, instead of using many str_replace($str, $chr, ""). I'd glad to > see this change also in 5.4. Do you mean that (the currently document

[PHP-DEV] Changed behaviour for strtr()

2011-06-20 Thread Robert Eisele
Here is the next one. I think it's quite intuitive to use strtr() to remove single characters of a string, too, instead of using many str_replace($str, $chr, ""). I'd glad to see this change also in 5.4. Additionally, I've removed the lookup-table generation as gcc doesn't optimize this away. Ro

Re: [PHP-DEV] Standard constants as part of the lexer

2011-06-20 Thread Robert Eisele
2011/6/20 Derick Rethans > On Mon, 20 Jun 2011, Robert Eisele wrote: > > > The constants true, false and null are used very often. Unfortunately, > > every usage of either of these constants invokes a constant lookup. > > There is no problem with this, constant lookups are fast, but I > > neverth

Re: [PHP-DEV] Standard constants as part of the lexer

2011-06-20 Thread Sebastian Bergmann
Am 20.06.2011 13:00, schrieb Derick Rethans: > Although it's a nice performance increase, I think that breaking > count() as a method name is not a good idea, as I would assume it's > used a lot. Even though count() and strlen() can be optimised that much, > how much does it buy a fully fledged

Re: [PHP-DEV] Optimized smart strings

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Robert Eisele wrote: > PHP makes use of the smart string library. I've optimized the > smart_str_append_long() macro in order to save one division per cycle. At > the moment one modulo and one division is used. The optimized version uses > one division (which gets optimized aw

Re: [PHP-DEV] Standard constants as part of the lexer

2011-06-20 Thread Derick Rethans
On Mon, 20 Jun 2011, Robert Eisele wrote: > The constants true, false and null are used very often. Unfortunately, > every usage of either of these constants invokes a constant lookup. > There is no problem with this, constant lookups are fast, but I > nevertheless implemented these constants d

[PHP-DEV] Optimized smart strings

2011-06-20 Thread Robert Eisele
PHP makes use of the smart string library. I've optimized the smart_str_append_long() macro in order to save one division per cycle. At the moment one modulo and one division is used. The optimized version uses one division (which gets optimized away in most situations) and one additional multiplic

[PHP-DEV] Standard constants as part of the lexer

2011-06-20 Thread Robert Eisele
The constants true, false and null are used very often. Unfortunately, every usage of either of these constants invokes a constant lookup. There is no problem with this, constant lookups are fast, but I nevertheless implemented these constants directly in the lexer to avoid these lookups. I'd be gl

Re: [PHP-DEV] [RFC] Object oriented session handlers

2011-06-20 Thread Richard Quadling
On 20 June 2011 01:39, Arpad Ray wrote: > On Mon, Jun 6, 2011 at 5:31 PM, Richard Quadling wrote: >> Not an internals expert, but I do have a question. >> >> When would the session handler object be destroyed? >> >> If sessions are being logged to a DB (maybe via a userland PHP class), >> is inte