[PHP-DEV] Complete traits redesign for 5.5

2012-12-18 Thread Dmitry Stogov
Hi, I'm going to take a deep look into trait implementation and provide a better solution for 5.5. The current implementation is really wired and makes a lot of troubles for maintenance and each new fix, makes new troubles :( I'm really sorry, I didn't pay enough attention to treats before 5.4

Re: [PHP-DEV] Complete traits redesign for 5.5

2012-12-18 Thread Stefan Marr
Hi Dmitry: On 18 Dec 2012, at 12:37, Dmitry Stogov wrote: I'm going to take a deep look into trait implementation and provide a better solution for 5.5. The current implementation is really wired and makes a lot of troubles for maintenance and each new fix, makes new troubles :( Sorry,

[PHP-DEV] Extension for str_replace / preg_replace with arrays

2012-12-18 Thread Stefan Neufeind
Hi, inside a framework-/scripting-project we've lately discussed string-replacements with arrays. Currently PHP supports either replacing one string by another or replacing first element from one array with first from another array. What I'd like to propose is for str_replace and preg_replace

Re: [PHP-DEV] Extension for str_replace / preg_replace with arrays

2012-12-18 Thread Leigh
Both str_replace and preg_replace already support some array based replacements, I think adding more options to these functions specifically would just lead to confusion. What you're proposing can already be achieved quite easily with preg_replace_callback and passing your array/options into the

Re: [PHP-DEV] Complete traits redesign for 5.5

2012-12-18 Thread Leigh
Hi Dmitry On 18 December 2012 11:37, Dmitry Stogov dmi...@zend.com wrote: The new solution may significantly change implementation and even behavior in some cases (e.g https://bugs.php.net/bug.php?id=62069). If you have any idea, do you know what the implications of your changes are on APC?

Re: [PHP-DEV] Extension for str_replace / preg_replace with arrays

2012-12-18 Thread Stefan Neufeind
Hi, On 12/18/2012 01:16 PM, Leigh wrote: Both str_replace and preg_replace already support some array based replacements, I think adding more options to these functions specifically would just lead to confusion. Well, yes and no. Currently you have to supply either one string to replace with

Re: [PHP-DEV] Extension for str_replace / preg_replace with arrays

2012-12-18 Thread Leigh
On 18 December 2012 13:24, Stefan Neufeind neufe...@php.net wrote: Since we already have functionality for replacing with arrays in place, I wondered if giving it one string to replace and then an array to choose the replacement from (rotating) would be an option. Currently that's unsupported

[PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread Victor Berchet
Dear all: I would like to get your feedback on implementing some more data structure in the PHP core. Things like Set, Map could be really helpful. A Set would be an unordered collection with no duplicate elements (same as in Python) $setA = new Set(); $setA-append('a');

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread William Fitch
On Dec 18, 2012, at 9:43 AM, Victor Berchet vic...@suumit.com wrote: Dear all: I would like to get your feedback on implementing some more data structure in the PHP core. Things like Set, Map could be really helpful. A Set would be an unordered collection with no duplicate elements

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread jpauli
On Tue, Dec 18, 2012 at 3:43 PM, Victor Berchet vic...@suumit.com wrote: Dear all: I would like to get your feedback on implementing some more data structure in the PHP core. Things like Set, Map could be really helpful. A Set would be an unordered collection with no duplicate elements

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread Ángel González
On 18/12/12 15:43, Victor Berchet wrote: Dear all: I would like to get your feedback on implementing some more data structure in the PHP core. (...) I think this could be summarised as allow objects as keys for arrays. Which would give the Map behavior. Implementing Set from that is

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread Anthony Ferrara
Guys, PHP arrays are a great one-size-fits-all data structure. But like all one-size-fits-all anything, jack-of-all-trades usually means master of none. There are definitely benefits to using specific data structures if implemented correctly under the hood. A good example of this is a Queue.

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread Victor Berchet
I am happy to see some interest in this discussion, I'll try to give more details in the coming days. To clarify, my first example should be: $setA = new Set(); $setA-append('a'); $setA-append('a'); $setB = new Set(); $setB-append('a'); // 'a' instead of 'b' $setA == $setB; Cheers, Victor

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread Anthony Ferrara
Victor, If you give a closer look to my example, you will notice a difference: $map[$setA] and $map[$setB] point to the same storage which I think is not possible with SPLObjectStorage. Well, how could you do that? Without implementing object comparison methods at least (which is outside the

Re: [PHP-DEV] How about implementing more data structures (ie Map, Set)

2012-12-18 Thread Victor Berchet
On 12/18/2012 07:46 PM, Anthony Ferrara wrote: Victor, If you give a closer look to my example, you will notice a difference: $map[$setA] and $map[$setB] point to the same storage which I think is not possible with SPLObjectStorage. Well, how could you do that? Without

Re: [PHP-DEV] Complete traits redesign for 5.5

2012-12-18 Thread Stas Malyshev
Hi! I'm going to take a deep look into trait implementation and provide a better solution for 5.5. The current implementation is really wired and makes a lot of troubles for maintenance and each new fix, makes new troubles :( I'm really sorry, I didn't pay enough attention to treats before

[PHP-DEV] Changes in libcurl for CURLOPT_SSL_VERIFYHOST in 7.28.1

2012-12-18 Thread Pierrick Charron
Hi all, About 2 month ago, we had a discussion on this list about the fact that CURLOPT_SSL_VERIFYHOST was most of the time used with a Boolean value (true) instead of int values (0,1 or 2). This bad usage was leading to some security issues. The result of this discussion was to trigger a notice

Re: [PHP-DEV] Complete traits redesign for 5.5

2012-12-18 Thread Dmitry Stogov
Hi, opcode caches support is one of the problem we have with current implementation. 5.4.10 seems just can't work with any cache at all. Of course, I'll care about it, and may give suggestions for necessary APC changes. Thanks. Dmitry. On Tue, Dec 18, 2012 at 5:03 PM, Leigh lei...@gmail.com

Re: [PHP-DEV] Complete traits redesign for 5.5

2012-12-18 Thread Dmitry Stogov
Hi Stas, On Wed, Dec 19, 2012 at 1:25 AM, Stas Malyshev smalys...@sugarcrm.comwrote: Hi! I'm going to take a deep look into trait implementation and provide a better solution for 5.5. The current implementation is really wired and makes a lot of troubles for maintenance and each new