Re: [ZEND-ENGINE-CVS] cvs: Zend / zend.c zend_execute_API.c zend_globals.h

From: Date: Thu, 10 Oct 2002 22:59:13 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: Zend / zend.c zend_execute_API.c zend_globals.h
References: 1 2 3  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-497@lists.php.net to get a copy of this message
On October 10, 2002 06:11 pm, Zeev Suraski wrote: > After a short talk with Andi, it seems that this patch is fine. Reasoning: > > Other languages like C don't mind the round trip, either. printf() will > format stuff according to the locale settings, even though you cannot write > locale-aware numbers inside your C code. Actually the patch is not entirely ok, it is missing TSRMLS_FETCH(); inside the zend_make_printable_zval(). That needs to be added to make it compile properly with ZTS, I will do so momentarily. There are 2 more issues I am afraid I must harass you about. First of all, is this patch acceptable for ZE2 commit? Secondly, is the example shown by Andi, a bug to be fixed or should this simply be documented as expected behavior, since it does not work for the same reason as $a = 1,23; would not work? Ilia > Also, > > $foo = array(); > > doesn't survive the round-trip either... > > At 23:49 10/10/2002, Andi Gutmans wrote: > >At 06:05 PM 10/10/2002 -0400, Ilia A. wrote: > >>On October 10, 2002 05:25 pm, Andi Gutmans wrote: > >> > I know but this does mean that the round trip wouldn't work. For > >> > example, eval('$a = print $b;'); would yield a parse error because > >> > you'd get $a = 1,3; Maybe we need to fix the echo command. I think > >> > things should be consistent. > >> > >>Actually that would not be a parse error, the value of $a would become 1 > >>because the parser will stop at 1st unknown character which would be ',' > >> and only convert '1' to int. But, you are correct eval() condition is > >> not covered by this situation. > >>There are 2 solutions that I can see to this, 1st is that we always use > >>'.' as > >>a decimal point no matter what the locale settings tell us, this may > >> however break BC for people who expect to see 1,2 when they export > >> LC_NUMERIC. The other solution is to allow Zend Engine to handle ',' as > >> a decimal point, which would allow parsing of things like 1,2 if that is > >> what the locale supports. > > > >I definitely don't want to support 1,2. I would like to see the same > >approach as in other languages where you need to use the US decimal > >system. Therefore, I prefer always using ".". I am aware that we might > >break BC so if people feel this can't be changed I at least don't want to > >make things worse and therefore would like to see your change reversed. > > > >Andi > > > > > >-- > >Zend Engine CVS Mailing List (http://cvs.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.zend-engine.cvs (#497) next »