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, wrote: > >This is not the same at all. When are you going to run this code? Memory > allocations happen all the time.

[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 session_star

[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 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; } > catch (Exceptio

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 jo

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 w

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 J

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-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 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 RFC was acce

Re: [PHP-DEV] Questions regarding DateTimeImmutable

2013-03-06 Thread Nikita Popov
On Wed, Feb 20, 2013 at 11:21 AM, Gustavo Lopes wrote: > 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 functions that actu

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 zv

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 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 from >

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 wrote: > On Wed, Mar 6, 2013 at 5:41 PM, Dmitry Stogov 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 d

[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 P

[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" : > 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

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 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" : > >> On 3/6/13 4:10 PM, Bob Weinand wrote: >>> https://wiki.php.net

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

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 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: http://www.php.net/unsub.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:10 PM, Bob Weinand 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 feedback, >

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 wrote: > > > > On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand 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 D

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 wrote: > On Wed, Mar 6, 2013 at 10:38 PM, Ferenc Kovacs wrote: > > > > > > > > > On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand > wrote: > > > >> Hi! > >> > >> As this seem to require a RFC, here is it: > >> > >> https://wiki.php.net/rfc/unset_bool >

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" : > > > > On Wed, Mar 6, 2013 at 10:41 PM, Bob Weinand wrote: > Am 06.03.2013 um 22:38 schrieb "Ferenc Kovacs" : > >> >> On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand wrote: >> Hi! >> >> As this seem to require a RFC, here is it: >> >> https:/

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 wrote: > Am 06.03.2013 um 22:47 schrieb "Ferenc Kovacs" : > > > > > On Wed, Mar 6, 2013 at 10:41 PM, Bob Weinand wrote: > >> Am 06.03.2013 um 22:38 schrieb "Ferenc Kovacs" : >> >> >> On Wed, Mar 6, 2013 at 10:10 PM, Bob Weinand wrote: >> >>> Hi! >>>

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 : > On Wed, Mar 6, 2013 at 4:44 PM, Bob Weinand wrote: > Am 06.03.2013 um 22:39 schrieb "Will Fitch" : > >> On Wed, Mar 6, 2013 at 4:10 PM, Bob Weinand wrote: >> Hi! >> >> As this seem to require a RFC, here is it: >> >> https://wiki.php.net/rfc/unset_b

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 wrote: > Am 6.3.2013 um 22:50 schrieb Will Fitch : > > On Wed, Mar 6, 2013 at 4:44 PM, Bob Weinand wrote: > >> Am 06.03.2013 um 22:39 schrieb "Will Fitch" : >> >> On Wed, Mar 6, 2013 at 4:10 PM, Bob Weinand wrote: >> >>> Hi! >>> >>> As this seem to re

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 : > On Wed, Mar 6, 2013 at 5:25 PM, Bob Weinand wrote: > Am 6.3.2013 um 22:50 schrieb Will Fitch : >> On Wed, Mar 6, 2013 at 4:44 PM, Bob Weinand wrote: >> Am 06.03.2013 um 22:39 schrieb "Will Fitch" : >>> On Wed, Mar 6, 2013 at 4:10 PM, Bob Weinand wrote:

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, i