Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Derick Rethans
On Wed, 3 Nov 2004, Hartmut Holzgraefe wrote: > Derick Rethans wrote: > > On Wed, 3 Nov 2004, Moriyoshi Koizumi wrote: > > > >>I suppose the root of the problem is that the engine relies on > >>strtod() that is affected by the locale settings. IIRC, > >>there are some threads regarding this... I

Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Hartmut Holzgraefe
Derick Rethans wrote: On Wed, 3 Nov 2004, Moriyoshi Koizumi wrote: I suppose the root of the problem is that the engine relies on strtod() that is affected by the locale settings. IIRC, there are some threads regarding this... I can't name one though. I think a much better solution would be to use

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Jochem Maas
Hi Andrey, I have to confess my understanding of the engine internals is next to zero, but I do understand that var_dump and print_r were created with/for different pretexts. I agree with you that printing nothing for NULL is doesn't feel right (btw boolean false has the same effect) - this can

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Moriyoshi Koizumi
> > Did you mean "$e[0]->a->prop" by "$d[0]->a->prop"? > > Well, when I was writing the test I made a mistake which > I saw later but my mistake lead to a PHP core dump. Looks more like I should've read the mail more carefully :) Moriyoshi -- PHP Internals - PHP Runtime Development Mailing Lis

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Andrey Hristov
Moriyoshi Koizumi wrote: On 2004/11/03, at 22:31, Andrey Hristov wrote: $c=array($a,$b); var_dump($c,$d=serialize($c)); var_dump($e=unserialize($d)); $d[0]->a->prop=1; var_dump($d); ?> Did you mean "$e[0]->a->prop" by "$d[0]->a->prop"? Well, when I was writing the test I made a mistake which I saw

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Andrey Hristov
Hi, print_r() and var_dump() are quite different in their nature. print_r() is a thin wrapper around an internal Zend function (as far as I remember) while var_dump() is in ext/standard/var.c The do more or less the same job still some differences in the output (print_r() shows nothing on NULL var

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Moriyoshi Koizumi
On 2004/11/03, at 22:31, Andrey Hristov wrote: $c=array($a,$b); var_dump($c,$d=serialize($c)); var_dump($e=unserialize($d)); $d[0]->a->prop=1; var_dump($d); ?> Did you mean "$e[0]->a->prop" by "$d[0]->a->prop"? That looks like another issue: a->prop = 1; ?> Moriyoshi -- PHP Internals - PHP Runtime

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Francisco M. Marzoa Alonso
I think I understand the reason because I obtain that output, but I cannot figure out the motivations for doing it in that way. I should probably take a look at ZE sources. Thx. a lot by your help. Andrey Hristov wrote: Well, when there is traversion inside the engine, it checks whether it has

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Jochem Maas
Andrey Hristov wrote: Well, when there is traversion inside the engine, it checks whether it has processed a "node" already several times. As far as I remember the threshold is 3. So once it goes over $Arr, the counter increases to 1, the second time to 2 and third time it is 3 and ZE reports re

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Andrey Hristov
Well, when there is traversion inside the engine, it checks whether it has processed a "node" already several times. As far as I remember the threshold is 3. So once it goes over $Arr, the counter increases to 1, the second time to 2 and third time it is 3 and ZE reports recursion. HTH, Andrey Fra

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Francisco M. Marzoa Alonso
BTW., I'm not sure that there's nothing more wrong here. Takin the first part of the code of first example: $Arr = array(); $Arr['self'] = &$Arr; var_dump ( $Arr ); ?> It returns: array(1) { ["self"]=> array(1) { ["self"]=> *RECURSION* } } Is that as its expected to be? I meant that perhaps

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Andrey Hristov
Feel free to file a bug report at http://bugs.php.net .Mention in the subject there there is core dump. Thanks, Andrey Francisco M. Marzoa Alonso wrote: Should I fill a bug notification report or so? (where are them? ;-)) Andrey Hristov wrote: Francisco M. Marzoa Alonso wrote: Try this code: $Ar

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Francisco M. Marzoa Alonso
Should I fill a bug notification report or so? (where are them? ;-)) Andrey Hristov wrote: Francisco M. Marzoa Alonso wrote: Try this code: $Arr = array(); $Arr['self'] = &$Arr; var_dump ( $Arr ); $serdata = serialize ($Arr); $Arr2 = unserialize ( $serdata ); echo "\n\n"; var_dump ( $Arr2 ); ?>

Re: [PHP-DEV] ./configure, PHP, SuSE and the AMD64

2004-11-03 Thread Joe Orton
I've committed the core changes to add --with-libdir and updated most of the extensions which I could test here. Hans, can you test out HEAD on your SLES box? You should just use --with-libdir=lib64 and then e.g. --with-mysql=/usr will correctly pick up the system MySQL libraries in /usr/lib64.

Re: [PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Andrey Hristov
Francisco M. Marzoa Alonso wrote: Try this code: $Arr = array(); $Arr['self'] = &$Arr; var_dump ( $Arr ); $serdata = serialize ($Arr); $Arr2 = unserialize ( $serdata ); echo "\n\n"; var_dump ( $Arr2 ); ?> The second array is expected to be exactly as $Arr, but it doesn't. This is the output for

[PHP-DEV] serialize bug with array that references to itself?

2004-11-03 Thread Francisco M. Marzoa Alonso
Try this code: $Arr = array(); $Arr['self'] = &$Arr; var_dump ( $Arr ); $serdata = serialize ($Arr); $Arr2 = unserialize ( $serdata ); echo "\n\n"; var_dump ( $Arr2 ); ?> The second array is expected to be exactly as $Arr, but it doesn't. This is the output for that code: array(1) { ["self"]=

Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Moriyoshi Koizumi
On 2004/11/03, at 18:57, Derick Rethans wrote: I think a much better solution would be to use our own "strtod" function that isn't affected by locales then. I guess we could borrow a BSD implementatino of it and modify this to our needs. My +1 if some vote will take place. See also: http://marc.th

Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Derick Rethans
On Wed, 3 Nov 2004, Moriyoshi Koizumi wrote: > I suppose the root of the problem is that the engine relies on > strtod() that is affected by the locale settings. IIRC, > there are some threads regarding this... I can't name one though. I think a much better solution would be to use our own "strt

Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Moriyoshi Koizumi
On 2004/11/03, at 17:11, Derick Rethans wrote: It's assigned to me for now... I'll have a look at it this week. Does somebody remember why we need to mangle the locale anyway by resetting LC_NUMERIC to "C"? Good to hear the problem is then going to be addressed. According to the annotation, the cha

Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Derick Rethans
On Wed, 3 Nov 2004, Moriyoshi Koizumi wrote: > On 2004/10/30, at 21:43, Klaus Reimer wrote: > > > > > I think this explains the misbehaviour. If I do a "setlocale(LC_ALL, > > 'de_DE')" then the PHP function resets LC_NUMERIC to "C". So what > > chance have I to get the LC_NUMERIC configuration of

Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Moriyoshi Koizumi
On 2004/10/30, at 21:43, Klaus Reimer wrote: I think this explains the misbehaviour. If I do a "setlocale(LC_ALL, 'de_DE')" then the PHP function resets LC_NUMERIC to "C". So what chance have I to get the LC_NUMERIC configuration of a specific locale now? Well, I think there was a good reason to

Re: [PHP-DEV] localeconv not working

2004-11-03 Thread Klaus Reimer
Moriyoshi Koizumi wrote: Yup, save all the relevant environment variables beforehand and restore them with setlocale() after the localeconv() call. Either way, That's a valid bug that needs attention. It's already in the BTS (#30638) and is already assigned. -- Bye, K (Fid