php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28466 mb_convert_variables() clutters variables beyond the references, again.
Submitted: 2004-05-21 07:43 UTC Modified: 2004-06-24 00:07 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: s dot masugata at digicom dot dnp dot co dot jp Assigned: moriyoshi
Status: Closed Package: mbstring related
PHP Version: 4.3.6 OS: FreeBSD/Linux/Solaris(sparc)
Private report: No CVE-ID:
 [2004-05-21 07:43 UTC] s dot masugata at digicom dot dnp dot co dot jp
Description:
------------
See:http://bugs.php.net/bug.php?id=26639

Although the usual array is satisfactory, 
if array becomes a nest, it is still useless.


Reproduce code:
---------------
<?
// no problem.
$Array1  = array( "multi-byte string's" );
$Array2  = $Array1;

mb_convert_variables( "SJIS",
                      mb_detect_order( ),
                      $Array2 );

var_dump( $Array1 );
var_dump( $Array2 );

// unexpected operation.
$Array1  = array( "multi-byte string's", array( "multi-byte string's" ) );
$Array2  = $Array1;

mb_convert_variables( "SJIS",
                      mb_detect_order( ),
                      $Array2 );

var_dump( $Array1 );
var_dump( $Array2 );
?>

Expected result:
----------------
array(1) {
  [0]=>
  string(3) "no changed multi-byte string's"
}

array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}

array(1) {
  [0]=>
  string(3) "no changed multi-byte string's"
  [1]=>
   array(1) {
     [0]=>
     string(4) "no changed multi-byte string's"
   }
}

array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
  [1]=>
   array(1) {
     [0]=>
     string(4) "changed multi-byte string's"
   }
}


Actual result:
--------------
array(1) {
  [0]=>
  string(3) "no changed multi-byte string's"
}

array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
}

array(1) {
  [0]=>
  string(3) "no changed multi-byte string's"
  [1]=>
   array(1) {
     [0]=>
     string(4) "changed  multi-byte string's"
   }
}

array(1) {
  [0]=>
  string(3) "changed multi-byte string's"
  [1]=>
   array(1) {
     [0]=>
     string(4) "changed multi-byte string's"
   }
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-24 03:37 UTC] moriyoshi@php.net
Please don't create a new entry when it is closely 
related to the one that already exists. Add comments to 
that one.




 [2004-06-24 00:07 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 17:01:54 2014 UTC