#43414 [Fbk->Opn]: Surprising array bug found with special word "lang"

From: Date: Tue, 27 Nov 2007 14:00:42 +0000
Subject: #43414 [Fbk->Opn]: Surprising array bug found with special word "lang"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120139@lists.php.net to get a copy of this message
ID: 43414 User updated by: cappytoi at yahoo dot com Reported By: cappytoi at yahoo dot com -Status: Feedback +Status: Open Bug Type: Arrays related Operating System: Windows Xp PHP Version: 5.2.5 New Comment: I am using apache 2.59, and my Windows Locale is Turkish. But I think it is not about locale. Because when I test it with the enviroment on Centos apache 2.59 with php5.2.4 it gives me the same result and the locale is en_US. It may be caused by apache sapi. But the problem function is "implode()". It works normally when I parse the results with "foreach" Previous Comments: ------------------------------------------------------------------------ [2007-11-27 13:05:12] jani@php.net I tried with CLI: # src/build/php_5_2/sapi/cli/php t.php lang[]=turkce&lang[]=english&lang[]=german And no problems there. In what browser does it give you that? Have you got some weird locale set on your machine or what? ------------------------------------------------------------------------ [2007-11-26 17:28:20] cappytoi at yahoo dot com also found that using "times" instead of "lang" causes a similar result. ------------------------------------------------------------------------ [2007-11-26 17:12:05] cappytoi at yahoo dot com Description: ------------ Hi, I have found the following problem. I try to produce a query string and I found that using lang as a key makes problem with implode. Reproduce code: --------------- <?php $all = array( 'turkce', 'english', 'german' ); $t = array(); foreach ($all as $al) { $t[] = 'lang[]='.$al; } echo implode('&',$t); ?> Expected result: ---------------- lang[]=turkce&lang[]=english&lang[]=german Actual result: -------------- lang[]=turkce&#9001;[]=english&#9001;[]=german ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43414&edit=1

« previous php.bugs (#120139) next »