[PHP-DEV] Small performance improvement on main/rfc1867.c

2012-04-02 Thread Klaus Silveira
Just submitted a small patch here: https://github.com/php/php-src/pull/34 I had sent this before to gr...@php.net, before the GIT migration. Small fix really. The current code is correct, but if it is used inside a long loop or long strings, it's inefficient.

Re: [PHP-DEV] json_encode() and non-UTF8 strings

2012-04-02 Thread Adam Harvey
On 3 April 2012 09:46, Rasmus Lerdorf wrote: > On 04/02/2012 06:35 PM, Charlie Somerville wrote: >> I've created a pull request (https://github.com/php/php-src/pull/33) that >> changes json_encode to fall back to ASCII for strings that are not valid >> UTF-8. >> >> I ran into an issue in a produ

Re: [PHP-DEV] json_encode() and non-UTF8 strings

2012-04-02 Thread Rasmus Lerdorf
On 04/02/2012 06:35 PM, Charlie Somerville wrote: > Hi internals, > > I've created a pull request (https://github.com/php/php-src/pull/33) that > changes json_encode to fall back to ASCII for strings that are not valid > UTF-8. > > I ran into an issue in a production application involving PayP

[PHP-DEV] json_encode() and non-UTF8 strings

2012-04-02 Thread Charlie Somerville
Hi internals, I've created a pull request (https://github.com/php/php-src/pull/33) that changes json_encode to fall back to ASCII for strings that are not valid UTF-8. I ran into an issue in a production application involving PayPal IPN callbacks (which are sent encoded as windows-1252) and js

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Charlie Somerville
Magnus Holm has an excellent proof of concept for this in Ruby, which supports continuations: http://timelessrepo.com/never-gonna-let-you-go On Apr 2, 2012 10:44 PM, "Rasmus Schultz" wrote: > I was just reading about the new async/await keywords in C# 5.0, and while > this has no particular rele

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Samuel Giles
Sorry, as an add on to my previous, a feature request was opened on the Bug tracker in 2010 #51460 for a yield syntax construct Sam. On Mon, Apr 2, 2012 at 10:51 PM, Samuel Giles wrote: > Hi Anthony, > > Ok, I see that now. I know you're not necessarily sa

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Samuel Giles
Hi Anthony, Ok, I see that now. I know you're not necessarily saying what's been proposed is a good idea but I can see a benefit in pythonic style generators as a separate piece of functionality, implementing a yield function, has this ever been discussed before? My apologies if this is the case I

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Anthony Ferrara
Sam, I'm not saying it's a good idea, but this would allow for pythonic style generators. http://wiki.python.org/moin/Generators Just pointing out one potential use-case... Anthony On Mon, Apr 2, 2012 at 4:35 PM, Samuel Giles wrote: > Hi Internals > > function test() >> { >>  echo "Begin Test

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Samuel Giles
Hi Internals function test() > { > echo "Begin Test!\n"; > > throw new Interrupt(); > > echo "Execution resumed!"; > } > > try > { > test(); > } > catch (Interrupt $e) > { > echo "Execution interrupted.\n"; > resume; > } > > The output of this would be: > > Begin Test! > Execution interrupte

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Johannes Schlüter
On Tue, 2012-04-03 at 00:49 +0500, Alexey Shein wrote: > 3 апреля 2012 г. 0:40 пользователь Johannes Schlüter > написал: > > On Mon, 2012-04-02 at 08:44 -0400, Rasmus Schultz wrote: > >> I was just reading about the new async/await keywords in C# 5.0, and while > >> this has no particular relevanc

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Galen Wright-Watson
On Mon, Apr 2, 2012 at 5:44 AM, Rasmus Schultz wrote: > I was just reading about the new async/await keywords in C# 5.0, and while > this has no particular relevance to PHP as such, it got me thinking about > this idea... > > What if you could resume execution after an exception was thrown? > > T

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Alexey Shein
3 апреля 2012 г. 0:40 пользователь Johannes Schlüter написал: > On Mon, 2012-04-02 at 08:44 -0400, Rasmus Schultz wrote: >> I was just reading about the new async/await keywords in C# 5.0, and while >> this has no particular relevance to PHP as such, it got me thinking about >> this idea... >> >>

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Johannes Schlüter
On Mon, 2012-04-02 at 08:44 -0400, Rasmus Schultz wrote: > I was just reading about the new async/await keywords in C# 5.0, and while > this has no particular relevance to PHP as such, it got me thinking about > this idea... > > What if you could resume execution after an exception was thrown? So

Re: [PHP-DEV] resume after exception

2012-04-02 Thread Ivan Enderlin @ Hoa
Hi Rasmus, On 02/04/12 14:44, Rasmus Schultz wrote: I was just reading about the new async/await keywords in C# 5.0, and while this has no particular relevance to PHP as such, it got me thinking about this idea... What if you could resume execution after an exception was thrown? Fictive examp

[PHP-DEV] resume after exception

2012-04-02 Thread Rasmus Schultz
I was just reading about the new async/await keywords in C# 5.0, and while this has no particular relevance to PHP as such, it got me thinking about this idea... What if you could resume execution after an exception was thrown? Fictive example: function test() { echo "Begin Test!\n"; throw

Re: [PHP-DEV] Addition of calendar to intl

2012-04-02 Thread Pierre Joye
On Mon, Apr 2, 2012 at 11:45 AM, Gustavo Lopes wrote: > In sum, I don't think it hurts much and it helps the extension stay > consistent. It can hurt in the sense that the procedural is ugly in this case and nobody sane will ever use it. Introducing useless new functions do not sound like a good

Re: [PHP-DEV] Addition of calendar to intl

2012-04-02 Thread Gustavo Lopes
On Mon, 02 Apr 2012 11:44:17 +0200, Derick Rethans wrote: On Mon, 2 Apr 2012, Johannes Schlüter wrote: Basically it is good to have those calender stuff available. I wonder how this relates to our datelib. Can this somehow be integrated, at least for Gregorian calender times, so one can easily

Re: [PHP-DEV] Addition of calendar to intl

2012-04-02 Thread Gustavo Lopes
On Mon, 02 Apr 2012 11:13:02 +0200, Pierre Joye wrote: The only thing I really dislike is the procedural API. The prefix "intlcal_" is not very nice, but what I really doubt is the usefulness of the procedural APIs for the Calendar resources. It makes little to no sense to have it as it bring

Re: [PHP-DEV] Addition of calendar to intl

2012-04-02 Thread Derick Rethans
On Mon, 2 Apr 2012, Johannes Schlüter wrote: > On Mon, 2012-04-02 at 10:35 +0200, Gustavo Lopes wrote: > > > > I have exposed ICU's Calendar API to PHP via the intl extension. It > > allows date calculations with Gregorian, Chinese, Coptic, Ethiopic, > > Hebrew, Indian, Islamic (civil/religious

Re: [PHP-DEV] Addition of calendar to intl

2012-04-02 Thread Johannes Schlüter
On Mon, 2012-04-02 at 10:35 +0200, Gustavo Lopes wrote: > Hi > > I have exposed ICU's Calendar API to PHP via the intl extension. It allows > date calculations with Gregorian, Chinese, Coptic, Ethiopic, Hebrew, > Indian, Islamic (civil/religious), Japanese, Persian, Taiwan and Thai > Buddhis

Re: [PHP-DEV] Addition of calendar to intl

2012-04-02 Thread Pierre Joye
hi Gustavo, Very nice job :) The only thing I really dislike is the procedural API. The prefix "intlcal_" is not very nice, but what I really doubt is the usefulness of the procedural APIs for the Calendar resources. It makes little to no sense to have it as it brings nothing in comparison to the

Re: [PHP-DEV] Perl logo in the php website

2012-04-02 Thread Kiall Mac Innes
LOL - Nice ;) Thanks, Kiall Sent from my phone. On Apr 2, 2012 7:42 a.m., "Charlie Somerville" < char...@charliesomerville.com> wrote: > April fools > > > On Monday, 2 April 2012 at 4:41 PM, Eloy Bote Falcon wrote: > > > Hi internals, > > > > Maybe this is not the correct list to ask this, but w

[PHP-DEV] Addition of calendar to intl

2012-04-02 Thread Gustavo Lopes
Hi I have exposed ICU's Calendar API to PHP via the intl extension. It allows date calculations with Gregorian, Chinese, Coptic, Ethiopic, Hebrew, Indian, Islamic (civil/religious), Japanese, Persian, Taiwan and Thai Buddhist calendars. For a broader overview of its functionality, see: ht