php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50474 spl_object_hash returns same value for different objects
Submitted: 2009-12-14 23:37 UTC Modified: 2009-12-15 09:23 UTC
From: php dot net at karlsruler dot de Assigned:
Status: Not a bug Package: SPL related
PHP Version: 5.3SVN-2009-12-14 (snap) OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php dot net at karlsruler dot de
New email:
PHP Version: OS:

 

 [2009-12-14 23:37 UTC] php dot net at karlsruler dot de
Description:
------------
spl_object_hash returns the same hash sum for different objects. First I have to say, I'm using PHP 5.3.2dev, compiled with VC9:

System 	Windows NT CHRISTIAN-PC 6.1 build 7100 ((null)) i586
Build Date 	Dec 6 2009 20:47:34
Compiler 	MSVC9 (Visual C++ 2008)
Architecture 	x86
Configure Command 	cscript /nologo configure.js "--enable-snapshot-build" "--disable-isapi" "--enable-debug-pack" "--disable-isapi" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" "--with-oci8-11g=D:\php-sdk\oracle\instantclient11\sdk,shared" "--with-enchant=shared"
Server API 	Apache 2.0 Handler 
PHP API 	20090626
PHP Extension 	20090626
Zend Extension 	220090626
Zend Extension Build 	API220090626,TS,VC9
PHP Extension Build 	API20090626,TS,VC9
Debug Build 	no
Thread Safety 	enabled 

this allows me using Imagick-Extension on Windows Systems.

I hope I'm not reporting stupid things (f.e. SPL not working on Windows 7 or VC9 or ..), but I would assume, that this should always return different values.

Reproduce code:
---------------
<?php
require "./init.php";

$header = new Text("Das ist mein erstes Layout.");
$header->getPadding()->set(5);
$footer = new Text(".. und das wars auch schon wieder.\nBis zum n?chsten Mal!");
$footer->getPadding()->set(5);

$layout = new Layout_Vertical();
$layout->add($header);
$layout->add($footer);

echo spl_object_hash($header), "<br />";
echo spl_object_hash($footer), "<br />";
echo spl_object_hash($layout), "<br />";
// exit;

$renderer = new Renderer_Imagick($layout);
echo $renderer->display();
?>

Expected result:
----------------
different hash sums

Actual result:
--------------
000000002bb405ee00000000344e0650
000000002bb405ec00000000344e0650
000000002bb405e900000000344e0650

(refreshing page)

0000000001202cce0000000040e8d071
0000000001202ccc0000000040e8d071
0000000001202cc90000000040e8d071

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-15 01:17 UTC] felipe@php.net
It's not same.. See:
000000002bb405e[e]00000000344e0650
000000002bb405e[c]00000000344e0650
000000002bb405e[9]00000000344e0650


 [2009-12-15 09:23 UTC] php dot net at karlsruler dot de
sorry about that, I shouldn't report bugs after midnight
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 11:01:32 2024 UTC