[PHP-DEV] Scalar Type Casting Magic Methods

2013-05-04 Thread Oleku Konko
Quick Observations :  I had this issue (  http://stackoverflow.com/questions/16375331/increment-on-tostring ) and it kept me thinking why no error was returned, then i stumble up this RFC :   https://wiki.php.net/rfc/object_cast_to_types The patch is basic , simple and working and it should be s

[PHP-DEV] Scalar Type Casting Magic Methods

2013-05-04 Thread Oleku Konko
Quick Observations :  I had this issue (  http://stackoverflow.com/questions/16375331/increment-on-tostring ) and it kept me thinking why no error was returned, then i stumble up this RFC :   https://wiki.php.net/rfc/object_cast_to_types The patch is basic , simple and working and it should be s

[PHP-DEV] Proposal: new implentation of JSON extension.

2013-05-04 Thread Remi Collet
Raise again this discussion as no feedback on pecl ML. Trying to solve https://bugs.php.net/bug.php?id=63520 I start to work on a dropin alternative for current json extension in php. Current work: https://github.com/remicollet/pecl-json-c It is obviously to late for PHP 5.5, and need probabl

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Rasmus Lerdorf
On 05/04/2013 08:28 AM, Laruence wrote: > and inefficent not always means performance only, in this case , you > need to define various functions for different regexs if you use loop style. > > and do you prefer array_walk or foreach when you try to iteraterly > process an array? I certainly

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Laruence
I made a RFC for this: https://wiki.php.net/rfc/second_arg_to_preg_callback thanks On Sat, May 4, 2013 at 10:28 PM, Laruence wrote: > > > > On Sat, May 4, 2013 at 9:46 PM, Anthony Ferrara wrote: > >> Laruence, >> >> > foreach ($replacements as $regex => $callback) { >> > > $str = preg_re

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Laruence
On Sat, May 4, 2013 at 9:46 PM, Anthony Ferrara wrote: > Laruence, > > > foreach ($replacements as $regex => $callback) { > > > $str = preg_replace_callback($regex, $callback, $str); > > > } > > > > > > > So if there are 10 regex in the array, you will got 10 DO_FCALL. 10 > times > > argumen

[PHP-DEV] [RFC] Add a second argument to callback of preg_replace_callback

2013-05-04 Thread Laruence
Hey: I thought it is a minor change, so was not plan to make a RFC .. but since there are some insistent objections, I think a RFC is better. let's people vote for it. here is the RFC: https://wiki.php.net/rfc/second_arg_to_preg_callback and objections are also listed. thanks -- La

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Anthony Ferrara
Laruence, > foreach ($replacements as $regex => $callback) { > > $str = preg_replace_callback($regex, $callback, $str); > > } > > > > So if there are 10 regex in the array, you will got 10 DO_FCALL. 10 times > arguments accept, 10 times etc... > > and AS I already said: IT is inefficient. I

[PHP-DEV] Multi-level Caching Fork of OPcache -- update

2013-05-04 Thread Terry Ellison
Please treat this email by way of request for feedback from the OPcache developers and anyone interested in influencing my next steps on my https://github.com/TerryE/opcache fork of OPcache and specifically on the dev-filecache branch. The most appropriate channel is probably https://github.co

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Laruence
On Sat, May 4, 2013 at 8:58 PM, Nikita Popov wrote: > On Sat, May 4, 2013 at 2:52 PM, Laruence wrote: > >> >> >> >> On Sat, May 4, 2013 at 8:49 PM, Nikita Popov wrote: >> >>> On Sat, May 4, 2013 at 2:39 PM, Laruence wrote: >>> Hey: Sorry for the delay, the new patch, which make th

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Nikita Popov
On Sat, May 4, 2013 at 2:52 PM, Laruence wrote: > > > > On Sat, May 4, 2013 at 8:49 PM, Nikita Popov wrote: > >> On Sat, May 4, 2013 at 2:39 PM, Laruence wrote: >> >>> Hey: >>>Sorry for the delay, the new patch, which make the second argument >>> the >>> regex array keys is attached. >>> >

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Laruence
On Sat, May 4, 2013 at 8:49 PM, Nikita Popov wrote: > On Sat, May 4, 2013 at 2:39 PM, Laruence wrote: > >> Hey: >>Sorry for the delay, the new patch, which make the second argument the >> regex array keys is attached. >> >> >> >> https://bugs.php.net/patch-display.php?bug_id=64730&patch=sec

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Laruence
On Sat, May 4, 2013 at 8:49 PM, Nikita Popov wrote: > On Sat, May 4, 2013 at 2:39 PM, Laruence wrote: > >> Hey: >>Sorry for the delay, the new patch, which make the second argument the >> regex array keys is attached. >> >> >> >> https://bugs.php.net/patch-display.php?bug_id=64730&patch=sec

Re: [PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Nikita Popov
On Sat, May 4, 2013 at 2:39 PM, Laruence wrote: > Hey: >Sorry for the delay, the new patch, which make the second argument the > regex array keys is attached. > > > > https://bugs.php.net/patch-display.php?bug_id=64730&patch=second_arg_rege_key.patch&revision=latest > >with this patch,

[PHP-DEV] Re: [PROPOSAL]Add second to callback of preg_replace_callback

2013-05-04 Thread Laruence
Hey: Sorry for the delay, the new patch, which make the second argument the regex array keys is attached. https://bugs.php.net/patch-display.php?bug_id=64730&patch=second_arg_rege_key.patch&revision=latest with this patch, preg_replace_callback will call user callback with two arguments,