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

From: Date: Thu, 10 Oct 2002 22:11:27 +0000
Subject: Re: [ZEND-ENGINE-CVS] cvs: Zend / zend.c zend_execute_API.c zend_globals.h
References: 1 2 3 4  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-496@lists.php.net to get a copy of this message
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. 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 (#496) next »