Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30941 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11593 invoked by uid 1010); 14 Jul 2007 23:05:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11578 invoked from network); 14 Jul 2007 23:05:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jul 2007 23:05:21 -0000 Authentication-Results: pb1.pair.com header.from=schst@php-tools.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=schst@php-tools.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php-tools.net from 81.169.176.131 cause and error) X-PHP-List-Original-Sender: schst@php-tools.net X-Host-Fingerprint: 81.169.176.131 rot4.de Linux 2.5 (sometimes 2.4) (4) Received: from [81.169.176.131] ([81.169.176.131:53119] helo=mail.rot4.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/4C-05977-FA659964 for ; Sat, 14 Jul 2007 19:05:19 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.rot4.de (Postfix) with ESMTP id 0DB19B44015; Sun, 15 Jul 2007 01:05:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at rot4.de Received: from mail.rot4.de ([127.0.0.1]) by localhost (rot4.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hkwQu67QlTgJ; Sun, 15 Jul 2007 01:05:15 +0200 (CEST) Received: from [192.168.0.21] (p54A3C82F.dip0.t-ipconnect.de [84.163.200.47]) by mail.rot4.de (Postfix) with ESMTP id B4379B44010; Sun, 15 Jul 2007 01:05:15 +0200 (CEST) Message-ID: <469956B0.3020205@php-tools.net> Date: Sun, 15 Jul 2007 01:05:20 +0200 User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Pavel Shevaev CC: =?ISO-8859-1?Q?David_Z=FClke?= , internals internals , Marcus Boerger , Sebastian Bergmann References: <468519DC.8060502@widescreen.ch> <4685785E.5010709@zend.com> <585221804.20070701154538@marcus-boerger.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] toString() and Object #ID From: schst@php-tools.net (Stephan Schmidt) Hi Pavel, Pavel Shevaev wrote: > Folks, is this really wanted behavior? Because if so, why does the > following result in the same hash as well(PHP-5.2.1)? > > $ php -r "class Foo{};$foo = new > Foo();var_dump(spl_object_hash($foo));$foo->bar = > 1;var_dump(spl_object_hash($foo));" > > string(32) "d1f40a1cc04d8c79d09ae6262666adbb" > string(32) "d1f40a1cc04d8c79d09ae6262666adbb" Because you calculate the hash for the same object. It does not matter, that you changed a property, the $foo is still the same object. Best regards, Stephan