Re: [PHP-DEV] [RFC] Var_export tabbing

2011-01-24 Thread Johannes Schlüter
Hi, On Mon, 2011-01-24 at 13:26 -0500, Michael Morris wrote: > Anyway, var_export takes 2 arguments - the expression to be converted and > whether to return or echo it. I'd like to add a third, whether to use > spaces (default) or tabs for indentation While I'm not sure that's really needed: Why

[PHP-DEV] zend memory manager

2011-01-24 Thread Adi Mutu
Hello, Where can I find some references to read about the Zend mm? I'm not talking about emalloc/efree (or pemalloc/pefree), i'm talking about lower level functions like zend_mm_aloc_int and zend_mm_free_int, structs like zend_mm_heap etc.I've tried looking at the sources, but it's not ver

Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Johannes Schlüter
On Mon, 2011-01-24 at 19:11 +, Gustavo Lopes wrote: > Hum? Pierre's change is "correct", but it's also redundant. > > Please read the C FAQ: http://c-faq.com/null/ptrtest.html > > What would be invalid would be testing for a null pointer with something > like this: > > void *p; > ... > int

Re: [PHP-DEV] [RFC] Var_export tabbing

2011-01-24 Thread Michael Morris
That is the primary purpose. For most datasets str_replace(' ', "\t", var_export($obj, true)) gets what I want. But this is for exploration of process. I don't expect it to be committed to the language on a permanent basis. To be honest, it would be better as a php.ini setting - export_indentati

Re: [PHP-DEV] [RFC] Var_export tabbing

2011-01-24 Thread Hannes Landeholm
If you're looking into doing something that are both useful and good for learning C, my suggestion is to hack PHP in some way that makes something possible (in PHP) that you couldn't simply accomplish by writing a simple wrapper function or workaround. Making var_export use tabs instead of spaces i

Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Gustavo Lopes
On Mon, 24 Jan 2011 16:53:48 -, Johannes Schlüter wrote: On Mon, 2011-01-24 at 13:19 +0100, Pierre Joye wrote: NULL is for pointers where 0 is for integer-like. Testing if a ptr is NULL should be done by testing for NULL or not NULL. While compilers tolerate *ptr = 0 by casting 0 to N

[PHP-DEV] [RFC] Var_export tabbing

2011-01-24 Thread Michael Morris
I've been trying to think of something that would be a good project to cut my teeth on for a first C project in forever and I'd rather work on something that might be useful. While cleaning tabbing on a var_export for a test class I think I have an idea. What I'm looking for is two things. One, i

Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Johannes Schlüter
On Mon, 2011-01-24 at 13:19 +0100, Pierre Joye wrote: > > NULL is for pointers where 0 is for integer-like. > > Testing if a ptr is NULL should be done by testing for NULL or not > NULL. > > While compilers tolerate *ptr = 0 by casting 0 to NULL, any other > runtime check must use NULL. That's K

[PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Pierre Joye
On Mon, Jan 24, 2011 at 12:53 PM, Derick Rethans wrote: > On Mon, 24 Jan 2011, Pierre Joye wrote: > >> On Mon, Jan 24, 2011 at 11:15 AM, Derick Rethans wrote: >> >> > Why did you change this? It does exactly the same. >> >> No it does not. This test is now correct given its initial goal. > > Uh?

[PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Derick Rethans
On Mon, 24 Jan 2011, Pierre Joye wrote: > On Mon, Jan 24, 2011 at 11:15 AM, Derick Rethans wrote: > > > Why did you change this? It does exactly the same. > > No it does not. This test is now correct given its initial goal. Uh? Since when is: if (!foo) not the same as: if (foo

[PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Pierre Joye
hi, On Mon, Jan 24, 2011 at 11:15 AM, Derick Rethans wrote: > Why did you change this? It does exactly the same. No it does not. This test is now correct given its initial goal. Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime De

[PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/php_date.c trunk/ext/date/php_date.c

2011-01-24 Thread Derick Rethans
On Thu, 20 Jan 2011, Pierre Joye wrote: > pajoye Thu, 20 Jan 2011 07:05:34 + > > Revision: http://svn.php.net/viewvc?view=revision&revision=307618 > > Log: > - be sure that we got tzid by adding a default case [snip] > @@ -908,11 +897,24 @@ >