Date: 07/20/00
- Next message: Andi Gutmans: "Re: [PHP-DEV] Patch: PHP (cvs) on Itanium"
- Previous message: tmlam <email protected>: "[PHP-DEV] PHP 4.0 Bug #5687: Segmentation fault"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: mlemos <email protected>
Operating system: Linux RH 6
PHP version: 4.0.0
PHP Bug Type: Misbehaving function
Bug description: Unset() inconsistent treatment of resource values not as integers
Resource values like those returned by ImageCreate() are integers, despite when
they are echo'ed they expand to something like "Resource id #nnn".
However, it seems that when a resource value is used and array index,
Unset() does not take it as an integer unless you explicitly cast the
value. Try this script to see the problem.
<?
$resource=ImageCreate(1,1);
$array=array();
$array[$resource]=1;
Unset($array[$resource]);
echo IsSet($array[$resource])," ",serialize($array)," ",$resource," ",intval($resource),"\n";
Unset($array[intval($resource)]);
echo IsSet($array[$resource])," ",serialize($array)," ",$resource," ",intval($resource),"\n";
?>
-- 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: Andi Gutmans: "Re: [PHP-DEV] Patch: PHP (cvs) on Itanium"
- Previous message: tmlam <email protected>: "[PHP-DEV] PHP 4.0 Bug #5687: Segmentation fault"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

