Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87577 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36695 invoked from network); 3 Aug 2015 13:10:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2015 13:10:52 -0000 Authentication-Results: pb1.pair.com header.from=colder@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.181 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.217.181 mail-lb0-f181.google.com Received: from [209.85.217.181] ([209.85.217.181:35657] helo=mail-lb0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/54-13081-B586FB55 for ; Mon, 03 Aug 2015 09:10:52 -0400 Received: by lbbpo9 with SMTP id po9so3609655lbb.2 for ; Mon, 03 Aug 2015 06:10:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=6kwCsdkR8i0VLG/Gltvb1r1KUFyBMlP79EuqHzJT8+Q=; b=AyZy0SqaohDjCLmpdCJ5Sy+guSsjS60uBi9sM2OJxRAdXt9dYYz6uhfph8JTctyqvx fZseDsdMPmsJOCBIVfBj+aUpv1XBJBBwMXBolC1Nj4upsGtl6WHxnG4YokrSsmeja6mp FQrs7kHbUCfd3dWVWSV8sSqKn+2sAcPoqgt+nLiW5vLqi68rRQDtwVmQmI3/GcWRiHXx mBGi7CJuYiKzcCMhd2Qzg0x40MCQfcQEldeEjEPv7Av194B3BbDsYusdYtb2JrXR8KhM 6kERoBSrxlI1rDPuiZLlWFVLGDqWbk+6krfz/DgjT+Pgolk4fqNL5CkIdYiB/5L3F5Hi obAA== X-Received: by 10.112.143.136 with SMTP id se8mr16564885lbb.101.1438607448963; Mon, 03 Aug 2015 06:10:48 -0700 (PDT) MIME-Version: 1.0 References: <024101d0cbaa$f864aa50$e92dfef0$@belski.net> <55BDBE25.5050104@gmail.com> <55BE5B89.5080103@gmail.com> In-Reply-To: Date: Mon, 03 Aug 2015 13:10:35 +0000 Message-ID: To: Alexander Lisachenko , Nicolas Grekas Cc: Rowan Collins , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e011839b2f782d5051c67e515 Subject: Re: [PHP-DEV] Exposing object handles to userland From: colder@php.net (Etienne Kneuss) --089e011839b2f782d5051c67e515 Content-Type: text/plain; charset=UTF-8 On Mon, Aug 3, 2015 at 2:26 PM Alexander Lisachenko wrote: > Hello, internals! > > I like the idea to assign a custom identifier to the object, but why this > should be only in the core? Java has a method 'hashCode' which can be used > to return an unique identifier for specific object. Java's hashcode is not unique,it is not meant to be: two live objects can have the same hash. Having a hashCode method that returns 0 for all objects is a valid (albeit stupid) implementation. As for PHP, It seems like what people actually want is a unique identifier for objects (for the lifetime of the request), but they compromise and use the handle instead as it is available without userland counter. Best, --089e011839b2f782d5051c67e515--