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

2012-12-20 Thread Pierre Joye
hi Dmitry! On Thu, Dec 20, 2012 at 7:54 AM, Dmitry Stogov dmi...@zend.com wrote: Thanks a lot to work on that :) I'm not sure about APC, I saw the problem in ZendOptimizerPlus with php-5.4.10. O+ crashes (or corrupts memory and crashes on following requests) on each trait usage. The

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

2012-12-20 Thread Pierre Joye
btw, same to test your changes/branch, as we have seen some crashes happening more easily on windows (same bug(s) on linux but with harder to get them crash). On Thu, Dec 20, 2012 at 9:02 AM, Pierre Joye pierre@gmail.com wrote: hi Dmitry! On Thu, Dec 20, 2012 at 7:54 AM, Dmitry Stogov

Re: [PHP-DEV] zend_parse_parameters() improvements

2012-12-20 Thread Gustavo Lopes
Em 2012-12-19 22:07, Nikita Popov escreveu: On Wed, Jul 18, 2012 at 11:05 PM, Gustavo Lopes glo...@nebm.ist.utl.pt wrote: Some deficiencies in zpp have been constrai ning the implementation of common scenarios such as allow integer or NULL* or the more general allow different types for an

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

2012-12-20 Thread Dmitry Stogov
Hi Pierre, The following test may crash on the second request with opcode cache. ?php trait THello { public function hello() { echo 'Hello'; } } class TraitsTest { use THello; } $test = new TraitsTest(); $test-hello(); ? Valgrind shows the problem even if PHP doesn't crash. ==2623==

Re: [PHP-DEV] Crashes in lex_scan at Zend/zend_language_scanner.c / BUG #52752

2012-12-20 Thread Jani Ollikainen
Hi, If someone wants access to machine where you can reproduce this send me email. It's not just one machine where I can reproduce this, so can't blame hardware. Reproduced this there in CentOS 6.3 default php, php-5.3.19, php-5.4.9 and php-trunk-201212200830. What I noticed that with trunk I

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

2012-12-20 Thread jpauli
On Wed, Dec 19, 2012 at 5:35 AM, Pierrick Charron pierr...@webstart.frwrote: 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

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

2012-12-20 Thread Pierrick Charron
Hi Julien, I think we need to trigger a notice to prevent users to write code that may not work in future version even if it doesn't depend on our changes but on libraries changes. Maybe we could be more explicit and tell the user that the 1 value will not be available as of libcurl 7.28.1 (I

Re: [PHP-DEV] DateTime improvement

2012-12-20 Thread Larry Garfield
I've seen DateTimeValue used elsewhere for userspace immutable date time objects. Whether that indicates we SHOULD or SHOULD NOT use that for an in-C version, I don't know. (I'm inclined to say should-but-namespace, but I don't know if we're doing that yet.) Of course, I have no idea if

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

2012-12-20 Thread Larry Garfield
On 12/19/12 10:30 PM, Christopher Jones wrote: On 12/19/2012 03:18 PM, Larry Garfield wrote: You could likely simplify the code even further using an infinite iterator: http://us1.php.net/infiniteiterator $result = preg_replace_callback( '/word/', function($matches) use

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

2012-12-20 Thread jpauli
On Thu, Dec 20, 2012 at 4:57 PM, Pierrick Charron pierr...@webstart.frwrote: Hi Julien, I think we need to trigger a notice to prevent users to write code that may not work in future version even if it doesn't depend on our changes but on libraries changes. Maybe we could be more explicit

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

2012-12-20 Thread Pierrick Charron
I don't remember of any change in other binding (not saying there were not any) which like this one were removing a feature without giving an alternative to do the same thing. If someone can point me to one, I'll be glad to look at how we managed this. Pierrick On 20 December 2012 11:57, jpauli

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

2012-12-20 Thread Rasmus Lerdorf
On 12/20/2012 06:36 AM, Dmitry Stogov wrote: Hi Pierre, The following test may crash on the second request with opcode cache. ?php trait THello { public function hello() { echo 'Hello'; } } class TraitsTest { use THello; } $test = new TraitsTest(); $test-hello(); ?

[PHP-DEV] PHP5.5.0alpha2 release

2012-12-20 Thread jpauli
Hi Internals, We just tagged PHP 5.5.0alpha2 today. This release contains bug fixes against alpha1, as well as new features. The packages can be found at: http://downloads.php.net/dsp Please, note that the ext/mysql deprecation has been merged into this release. For other changes, as

Re: [PHP-DEV] Crashes in lex_scan at Zend/zend_language_scanner.c / BUG #52752

2012-12-20 Thread Stas Malyshev
Hi! ?php if ($argv[1] 0) { while ($argv[1]--) file_put_contents('test.tpl', ?php #.str_repeat('A', mt_rand(4000, 5000)). ?\n, LOCK_EX); } else { $p2 = popen(sapi/cli/php -n test3.php 100, r); while (1) include 'test.tpl'; } ? Yes, I can now reproduce this on my machine too.

Re: [PHP-DEV] DateTime improvement

2012-12-20 Thread Lazare Inepologlou
Of course, I have no idea if anyone in userspace is using DateTimeImmutable... Well, it seems unlikely, unless he is Yoda or French. I mean, in English, it is common to put the adjective in front of the noun, isn't it? Lazare INEPOLOGLOU Ingénieur Logiciel 2012/12/20 Larry Garfield

Fwd: [PHP-DEV] PHP5.5.0alpha2 release

2012-12-20 Thread Hannes Magnusson
From: jpauli jpa...@php.net Date: Thu, Dec 20, 2012 at 9:26 AM Subject: [PHP-DEV] PHP5.5.0alpha2 release To: PHP Internals internals@lists.php.net I would appreciate that you would use your full real name now that you are representing the project as a release manager. -Hannes -- PHP

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

2012-12-20 Thread Levi Morrison
As mentioned earlier, I've been working on a library(https://github.com/morrisonlevi/Ardent) with an honest effort to make the data-structures usable in several different programming styles. I've tried several designs, but requiring something to implement a `Comparable` interface turned out to

Re: [PHP-DEV] PHP5.5.0alpha2 release

2012-12-20 Thread Julien Pauli
On Thu, Dec 20, 2012 at 9:30 PM, Hannes Magnusson hannes.magnus...@gmail.com wrote: From: jpauli jpa...@php.net Date: Thu, Dec 20, 2012 at 9:26 AM Subject: [PHP-DEV] PHP5.5.0alpha2 release To: PHP Internals internals@lists.php.net I would appreciate that you would use your full real name

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

2012-12-20 Thread Dmitry Stogov
hi Rasmus, I don't know all the APC internals, but it seems it just doesn't free memory carefully. It sets zend_class_entry-refcount to something above 1000 and as result all the nested structures are not freed as expected by destroy_zend_class(). I'm not sure which side effects this may have,

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

2012-12-20 Thread Christopher Jones
On 12/20/2012 08:31 AM, Larry Garfield wrote: On 12/19/12 10:30 PM, Christopher Jones wrote: On 12/19/2012 03:18 PM, Larry Garfield wrote: You could likely simplify the code even further using an infinite iterator: http://us1.php.net/infiniteiterator $result = preg_replace_callback(

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

2012-12-20 Thread David Muir
On 21/12/12 10:34, Christopher Jones wrote: On 12/20/2012 08:31 AM, Larry Garfield wrote: On 12/19/12 10:30 PM, Christopher Jones wrote: On 12/19/2012 03:18 PM, Larry Garfield wrote: You could likely simplify the code even further using an infinite iterator:

Re: [PHP-DEV] DateTime improvement

2012-12-20 Thread Peter Cowburn
On 20 December 2012 20:06, Lazare Inepologlou linep...@gmail.com wrote: Of course, I have no idea if anyone in userspace is using DateTimeImmutable... Well, it seems unlikely, unless he is Yoda or French. I mean, in English, it is common to put the adjective in front of the noun, isn't it?

Re: [PHP-DEV] PHP5.5.0alpha2 release

2012-12-20 Thread Adam Harvey
On 21 December 2012 01:26, jpauli jpa...@php.net wrote: We just tagged PHP 5.5.0alpha2 today. This release contains bug fixes against alpha1, as well as new features. Are we going to have a news post for this on the Web site? (Alternative question: would you like me to write one?) Adam --

Re: [PHP-DEV] Crashes in lex_scan at Zend/zend_language_scanner.c / BUG #52752

2012-12-20 Thread Patrick Schaaf
On Thursday 20 December 2012 10:40:32 Stas Malyshev wrote: Hi! ?php if ($argv[1] 0) { while ($argv[1]--) file_put_contents('test.tpl', ?php #.str_repeat('A', mt_rand(4000, 5000)). ?\n, LOCK_EX); } else { $p2 = popen(sapi/cli/php -n test3.php 100, r); while (1)

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

2012-12-20 Thread Christopher Jones
On 12/20/2012 04:05 PM, David Muir wrote: The curiosity (bug?) is the need to call rewind(): $replacements_iterator = new InfiniteIterator(new ArrayIterator($replacements)); $replacements_iterator-rewind(); // why is the rewind needed? $result = preg_replace_callback( '/word/',

Re: [PHP-DEV] Crashes in lex_scan at Zend/zend_language_scanner.c / BUG #52752

2012-12-20 Thread Stas Malyshev
Hi! Is include supposed to take a LOCK_EX somehow? I can neither see that in php- src (5.4.9) nor APC-trunk, doing a cursory grepping. I'm not sure how any lock would help, since locks are optional, meaning you still can do the same thing without the locks. The prudent approach, which should