ID:               48170
 Updated by:       f...@php.net
 Reported By:      rodrigosouzadossantos at gmai dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         *Unicode Issues
 Operating System: Debian Lenny
 PHP Version:      6CVS-2009-05-06 (snap)
 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

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?

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

print_r( $result );

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

Result:
-------
Array
(
    [app1] => app value
    [app2] => some value
)
unicode(9) "app value"
NULL
 


Previous Comments:
------------------------------------------------------------------------

[2009-05-06 18:00:14] rodrigosouzadossantos at gmai dot com

Description:
------------
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:

Array
(
    [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:
--------------
NULL


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?


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48170&edit=1

Reply via email to