php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60643 wrong type for SplObjectStorage::GetHash
Submitted: 2012-01-03 16:03 UTC Modified: 2012-06-22 20:51 UTC
From: jthijssen at noxlogic dot nl Assigned: salathe (profile)
Status: Closed Package: SPL related
PHP Version: 5.4.0RC4 OS:
Private report: No CVE-ID: None
 [2012-01-03 16:03 UTC] jthijssen at noxlogic dot nl
Description:
------------
The SplObjectStorage::GetHash suggests that $object is of type 'string', while in fact, this should be type 'object', as suggested in the code.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-24 17:55 UTC] kissifrot at gmail dot com
Can you give a reproduce code ?
 [2012-03-05 18:32 UTC] jthijssen at noxlogic dot nl
<?php

$store = new SplObjectStorage();
$obj = new StdClass();

print $store->getHash($obj);
print $store->getHash("obj");


Output:
0000000041d100cf0000000071936ee6
Warning: SplObjectStorage::getHash() expects parameter 1 to be object, string given in /home/jthijssen/php-src/sapi/cli/test.php on line 9
 [2012-04-27 23:19 UTC] salathe@php.net
-Assigned To: +Assigned To: salathe
 [2012-06-22 20:49 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=326298
Log: minor improvements for SplObjectStorage::getHash() (doc #60643)
 [2012-06-22 20:51 UTC] salathe@php.net
The type hint for the $object parameter has been updated, as well has a few other 
small changes for that page.  Thanks!
 [2012-06-22 20:51 UTC] salathe@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Sep 27 17:01:24 2020 UTC