From:             php dot net at karlsruler dot de
Operating system: Windows 7
PHP version:      5.3SVN-2009-12-14 (snap)
PHP Bug Type:     SPL related
Bug description:  spl_object_hash returns same value for different objects

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

-- 
Edit bug report at http://bugs.php.net/?id=50474&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=50474&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=50474&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=50474&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=50474&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50474&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=50474&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=50474&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=50474&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=50474&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=50474&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=50474&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=50474&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=50474&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=50474&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=50474&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=50474&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=50474&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=50474&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=50474&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=50474&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=50474&r=mysqlcfg

Reply via email to