|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48170 Array key differentiates between unicode and binary strings
Submitted: 2009-05-06 18:00 UTC Modified: 2009-05-14 01:00 UTC
From: rodrigosouzadossantos at gmai dot com Assigned:
Status: No Feedback Package: *Unicode Issues
PHP Version: 6CVS-2009-05-06 (snap) OS: Debian Lenny
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-05-06 18:00 UTC] rodrigosouzadossantos at gmai dot com
I have a array that is populated with result query from a Postgres. The keys of array are the field name and the value are the field value. Like this:

    [app1] => app value
    [app2] => some value

Reproduce code:
$result[ 'app1' ] = 'app value';
$result[ 'app2' ] = 'some value';

print_r( $result );

var_dump( $result[ 'app1' ] );

Expected result:
string(9) "app value"

Actual result:

The result of var_dump is correct when is puts a 'b' (binary) before string, like:

var_dump( $result[ b'app1' ] );

Is it the expected behavior?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-06 19:50 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

Works for me with CVS HEAD on Debian lenny.
Are you sure the input from Postgres is not to blame?

$result[ 'app1' ] = 'app value';
$result[ 'app2' ] = 'some value';

print_r( $result );

var_dump( $result[ 'app1' ] );
var_dump( $result[ b'app1' ] );

    [app1] => app value
    [app2] => some value
unicode(9) "app value"
 [2009-05-08 18:36 UTC] rodrigosouzadossantos at gmail dot com

When I created this bug I missed my e-mail. I wrote '' instead of ''.

So I can not recover the password to edit this post and provide more information.

Is there any way to change my e-mail address?

Thank in advance.

Rodrigo Souza
 [2009-05-14 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 20 21:03:37 2021 UTC