|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20655 Arrays and Hashes get cut-off the first 4 characters
Submitted: 2002-11-26 12:52 UTC Modified: 2003-04-06 21:12 UTC
From: joel at elserver dot com Assigned:
Status: Closed Package: mbstring related
PHP Version: 4.2.3 OS: Linux Slackware 8.1 Kernel 2.419
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
6 + 35 = ?
Subscribe to this entry?

 [2002-11-26 12:52 UTC] joel at elserver dot com
Whenever a GET/POST is done from a web form, the resulting $_GET, $_POST arrays are auto-generated with the first 4 chars of the string cut-off IF the string is 4 or more chars.

For instance:

<form method="get">
name: <input type="text" name="test[name]"><br>
age: <input type="text" name="test[age]"><br>
<input type="submit">

completed with name = "123456"
and age = "654321"

would generate:

(with this code)

the following:

    [0] => 56
    [1] => 21

as you can see the first 4 chars have been truncated.

it's been done with linux slackware 8.1, kernel 2.4.19+grsecurity on AMD and Intel microprocessors.

the configure line:


./configure \
--prefix=/usr/local/php \
--enable-force-cgi-redirect \
--with-zlib \
--enable-sockets \
--with-mysql=/usr/local/mysql \
--enable-memory-limit \
--with-mm=/root/software/apache/mm-1.1.3/ \
--with-gd=/usr/local/gd-lib \
--enable-ftp \
--enable-calendar \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir= \
--enable-gd-native-ttf \
--with-mcrypt=/usr/local/lib/libmcrypt \
--enable-inline-optimization \
--enable-pcntl \
--enable-mbstring \
--enable-mbstr-enc-trans \
--enable-mbregex \
--with-imap=/root/software/lib/imap-2002/ \
--with-imap-ssl \

with version 4.2.3. have not tested any variants.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-26 12:55 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

Also try --disable-mbstring if you still want to use the released version.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 12:01:29 2024 UTC