Re: [PHP-DEV] Memory warning hook

2013-03-06 Thread Julien Pauli
One should try ext/memtrack http://pecl.php.net/package/memtrack Also ext/memprof https://github.com/arnaud-lb/php-memory-profiler/ Julien.Pauli On Tue, Mar 5, 2013 at 9:14 PM, nat...@starin.biz wrote: This is not the same at all. When are you going to run this code? Memory allocations

[PHP-DEV] Should sessions override user sent headers?

2013-03-06 Thread Nikita Nefedov
Hi, so I stumbled upon this bug report: https://bugs.php.net/bug.php?id=64357 It's fairly easily fixable, but I don't know if it's even a bug... The problem here: sessions always send Expire header (except for private_no_expire), so if user (php user) sent Expire header before

[PHP-DEV] Proposed changes to PHP language

2013-03-06 Thread Max Romanovsky
Dear PHP Community, I'd like to propose several changes to PHP core: 1. Allow re-throwing exceptions without losing original stack trace, like in other technologies: try {/*...*/} catch(Exception $e) { throw; } 2. Introduce base class for all PHP classes. E.g. Object. It would help

Re: [PHP-DEV] Proposed changes to PHP language

2013-03-06 Thread Leigh
On 6 March 2013 12:48, Max Romanovsky max.romanov...@gmail.com wrote: Dear PHP Community, I'd like to propose several changes to PHP core: 1. Allow re-throwing exceptions without losing original stack trace, like in other technologies: try {/*...*/} catch(Exception $e) { throw; }

Re: [PHP-DEV] Proposed changes to PHP language

2013-03-06 Thread Ivan Enderlin @ Hoa
On 06/03/13 13:48, Max Romanovsky wrote: Dear PHP Community, Hi, I'd like to propose several changes to PHP core: 1. Allow re-throwing exceptions without losing original stack trace, like in other technologies: try {/*...*/} catch(Exception $e) { throw; } throw $e will do the

Re: [PHP-DEV] Proposed changes to PHP language

2013-03-06 Thread Leigh
2. Introduce base class for all PHP classes. E.g. Object. It would help in type hinting and allow to add new common methods without any magic. Introduce a type-hint “object” would be better I think. It would replace is_object call. I wonder how much BC breakage there would be

Re: [PHP-DEV] Proposed changes to PHP language

2013-03-06 Thread Steve Clay
On 3/6/13 7:48 AM, Max Romanovsky wrote: 2. Introduce base class for all PHP classes. E.g. Object. It would help in type hinting and allow to add new common methods without any magic. Type-hinting for non-stdClass objects would be handy. Base class is like mutable Object.prototype in

Re: [PHP-DEV] Proposed changes to PHP language

2013-03-06 Thread Peter Lind
On 6 March 2013 15:50, Alexandre TAZ dos Santos Andrade alexandre...@gmail.com wrote: This item 2. Introduce base class for all PHP classes. E.g. Object. It would help in type hinting and allow to add new common methods without any magic. StdClass Already do that ?php class A {}

[PHP-DEV] Re: [VOTE] Allow non-scalar keys in foreach

2013-03-06 Thread Nikita Popov
On Wed, Feb 27, 2013 at 8:33 PM, Nikita Popov nikita@gmail.com wrote: Hi internals! I've opened the voting the the foreach-keys RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys#vote The discussion for this RFC can be found here: http://markmail.org/message/rzoacqaesxbd67lu The

Re: [PHP-DEV] Questions regarding DateTimeImmutable

2013-03-06 Thread Nikita Popov
On Wed, Feb 20, 2013 at 11:21 AM, Gustavo Lopes glo...@nebm.ist.utl.ptwrote: Em 2013-02-20 10:32, Stas Malyshev escreveu: This isn't really a good data since most of this code creates its own DateTime and thus there's very little relevancy to what we're talking about. If you look up the

Re: [PHP-DEV] Re: [VOTE] Allow non-scalar keys in foreach

2013-03-06 Thread Dmitry Stogov
Hi Nikita, few notes about the patch... - you may avoid estrndup() in zend_hash_current_key_zval_ex() for interned strings. - I didn't completely get why did you change the key operand type from IS_TMP_VAR to IS_VAR and how it affects performance As I understood now you need to allocate new

Re: [PHP-DEV] Re: [VOTE] Allow non-scalar keys in foreach

2013-03-06 Thread Nikita Popov
On Wed, Mar 6, 2013 at 5:41 PM, Dmitry Stogov dmi...@zend.com wrote: Hi Nikita, few notes about the patch... - you may avoid estrndup() in zend_hash_current_key_zval_ex() for interned strings. Good idea, I'll do that. - I didn't completely get why did you change the key operand type

Re: [PHP-DEV] Re: [VOTE] Allow non-scalar keys in foreach

2013-03-06 Thread Dmitry Stogov
On Wed, Mar 6, 2013 at 9:16 PM, Nikita Popov nikita@gmail.com wrote: On Wed, Mar 6, 2013 at 5:41 PM, Dmitry Stogov dmi...@zend.com wrote: Hi Nikita, few notes about the patch... - you may avoid estrndup() in zend_hash_current_key_zval_ex() for interned strings. Good idea, I'll do

[PHP-DEV] 回复: [PHP-DEV] Re: [VOTE] Allow non-scalar keys in foreach

2013-03-06 Thread Reeze Xia
Hi Nikita, I got some test failure with the patch, one test failure and some memory leaks. see: https://gist.github.com/reeze/5101596 -- reeze | reeze.cn 已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 在 2013年3月7日星期四,上午1:28,Dmitry Stogov 写道: On Wed, Mar 6, 2013 at 9:16 PM, Nikita

[PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Bob Weinand
Hi! As this seem to require a RFC, here is it: https://wiki.php.net/rfc/unset_bool Please feedback, Bob Weinand -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Steve Clay
On 3/6/13 4:10 PM, Bob Weinand wrote: https://wiki.php.net/rfc/unset_bool What's the return value of unset($setValue, $undefined) ? Steve Clay -- http://www.mrclay.org/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Bob Weinand
false. It's like unset($setValue) unset($undefined). I've clarified this in the RFC; thank you. Bob Weinand Am 06.03.2013 um 22:24 schrieb Steve Clay st...@mrclay.org: On 3/6/13 4:10 PM, Bob Weinand wrote: https://wiki.php.net/rfc/unset_bool What's the return value of unset($setValue,

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Florin Razvan Patan
Hello, On Wed, Mar 6, 2013 at 11:31 PM, Bob Weinand bobw...@hotmail.com wrote: false. It's like unset($setValue) unset($undefined). I've clarified this in the RFC; thank you. Bob Weinand Am 06.03.2013 um 22:24 schrieb Steve Clay st...@mrclay.org: On 3/6/13 4:10 PM, Bob Weinand wrote:

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Anthony Ferrara
Florin Would it make more sense to return an array with keys the name of the variables that were unset and the result for each of them? This way one could better handle 'false' being returned. I'm not sure if it's possible or not, I didn't had the time to check out the patch. If you need

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Ferenc Kovacs
On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand bobw...@hotmail.com wrote: Hi! As this seem to require a RFC, here is it: https://wiki.php.net/rfc/unset_bool Please feedback, Bob Weinand -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Will Fitch
On Wed, Mar 6, 2013 at 4:10 PM, Bob Weinand bobw...@hotmail.com wrote: Hi! As this seem to require a RFC, here is it: https://wiki.php.net/rfc/unset_bool I'm not a fan of this change, but if it's going to be discussed, the RFC should include baseline and RFC change benchmarks. Please

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Ferenc Kovacs
On Wed, Mar 6, 2013 at 10:38 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand bobw...@hotmail.com wrote: Hi! As this seem to require a RFC, here is it: https://wiki.php.net/rfc/unset_bool Please feedback, Bob Weinand -- PHP Internals - PHP

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Will Fitch
On Wed, Mar 6, 2013 at 4:40 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Wed, Mar 6, 2013 at 10:38 PM, Ferenc Kovacs tyr...@gmail.com wrote: On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand bobw...@hotmail.com wrote: Hi! As this seem to require a RFC, here is it:

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Bob Weinand
Am 06.03.2013 um 22:47 schrieb Ferenc Kovacs tyr...@gmail.com: On Wed, Mar 6, 2013 at 10:41 PM, Bob Weinand bobw...@hotmail.com wrote: Am 06.03.2013 um 22:38 schrieb Ferenc Kovacs tyr...@gmail.com: On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand bobw...@hotmail.com wrote: Hi! As

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Ferenc Kovacs
On Wed, Mar 6, 2013 at 10:49 PM, Bob Weinand bobw...@hotmail.com wrote: Am 06.03.2013 um 22:47 schrieb Ferenc Kovacs tyr...@gmail.com: On Wed, Mar 6, 2013 at 10:41 PM, Bob Weinand bobw...@hotmail.com wrote: Am 06.03.2013 um 22:38 schrieb Ferenc Kovacs tyr...@gmail.com: On Wed, Mar 6,

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Bob Weinand
Am 6.3.2013 um 22:50 schrieb Will Fitch willfi...@php.net: On Wed, Mar 6, 2013 at 4:44 PM, Bob Weinand bobw...@hotmail.com wrote: Am 06.03.2013 um 22:39 schrieb Will Fitch willfi...@php.net: On Wed, Mar 6, 2013 at 4:10 PM, Bob Weinand bobw...@hotmail.com wrote: Hi! As this seem to

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Will Fitch
On Wed, Mar 6, 2013 at 5:25 PM, Bob Weinand bobw...@hotmail.com wrote: Am 6.3.2013 um 22:50 schrieb Will Fitch willfi...@php.net: On Wed, Mar 6, 2013 at 4:44 PM, Bob Weinand bobw...@hotmail.com wrote: Am 06.03.2013 um 22:39 schrieb Will Fitch willfi...@php.net: On Wed, Mar 6, 2013 at 4:10

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Bob Weinand
Am 6.3.2013 um 23:30 schrieb Will Fitch wfi...@meetme.com: On Wed, Mar 6, 2013 at 5:25 PM, Bob Weinand bobw...@hotmail.com wrote: Am 6.3.2013 um 22:50 schrieb Will Fitch willfi...@php.net: On Wed, Mar 6, 2013 at 4:44 PM, Bob Weinand bobw...@hotmail.com wrote: Am 06.03.2013 um 22:39 schrieb

Re: [PHP-DEV] [RFC] unset(): return bool if the variable has existed

2013-03-06 Thread Stas Malyshev
Hi! RFC updated. Any other comments about this RFC? Could you provide a use case for this - which practical value this has? It also still contains factually incorrect claim that unset() is a function and that there's some inconsistency in the fact that it does not return value. Also, it is