Date: 02/09/00
- Next message: turadg <email protected>: "[PHP-DEV] Bug #3446: base64 decoding should be smart"
- Previous message: John Harris: "[PHP-DEV] [PHP3/4] ms-sql server connectivity: mssql_select_db se ems to fail to set default database name"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: faisal <email protected>
Operating system: Windows/Linux RH6
PHP version: 4.0 Beta 3
PHP Bug Type: Misbehaving function
Bug description: Problem with copying arrays....
[Posted to PHP4BETA list too]
Example: (as I stated)
<?
class myclass
{
var $MYARRAY;
function myclass ()
{
$this->MYARRAY[] = "faisal";
$this->MYARRAY[] = "nasim";
}
function test ()
{
$x = $this -> MYARRAY; # I want a copy!
unset ( $x[0] );
}
}
$test = new myclass;
print count ( $test -> MYARRAY ) . "<BR>"; # 2
$test -> test ();
print count ( $test -> MYARRAY ) . "<BR>"; # 1 !!
?>
The second returns 1 which is incorrect, since I never referenced the array, i wanted the copy instead!
Here is a test case submitted by Mr. Zeev, in reply to the message:
:
$foo[] = 1;
$foo[] = 2;
$bar = $foo;
unset($foo[0]);
print count($foo)."\n";
print count($bar)."\n";
I thought it was a problem with arrays with classes, but it turned out to be a buggy bug in the array structure....
Hope you'll nab this one (and quick!) ;)
Thank you.
There is no field for name in your form, I wonder if you need it! If you do, its Faisal.
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: turadg <email protected>: "[PHP-DEV] Bug #3446: base64 decoding should be smart"
- Previous message: John Harris: "[PHP-DEV] [PHP3/4] ms-sql server connectivity: mssql_select_db se ems to fail to set default database name"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

