Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54295 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91693 invoked from network); 2 Aug 2011 20:12:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2011 20:12:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=flavius.as@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=flavius.as@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) X-PHP-List-Original-Sender: flavius.as@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:41936] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/30-23901-94A583E4 for ; Tue, 02 Aug 2011 16:12:58 -0400 Received: by fxe23 with SMTP id 23so178082fxe.29 for ; Tue, 02 Aug 2011 13:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=vOgquxKGCvoqMq4nZ0+w9JFL0nVQah3hhL0at0ZZ5cs=; b=PwIB5OeSPmtYEVbF3L1syfz/TAUjDtEqNwULvAmA86qqxxZhapgdnGaB2CXYgormRB paenUo1oMvGcTPpK6ZxBt4Pt/wtgg/hJPMOOh4yVCS9/ipoQboVDIKZnq50WuriUUgWO Ly8wmaR+3wN430A5nx8HMihyJqUHSk7Tx0V88= Received: by 10.223.1.201 with SMTP id 9mr8714139fag.91.1312315974390; Tue, 02 Aug 2011 13:12:54 -0700 (PDT) Received: from [192.168.2.3] (chello080109207086.1.graz.surfer.at [80.109.207.86]) by mx.google.com with ESMTPS id a2sm69059fak.25.2011.08.02.13.12.53 (version=SSLv3 cipher=OTHER); Tue, 02 Aug 2011 13:12:53 -0700 (PDT) Message-ID: <4E385892.9090106@gmail.com> Date: Tue, 02 Aug 2011 22:05:38 +0200 User-Agent: I am harmful. Fear me please :-) Mnenhy/0.7.6.666 MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Q] references and objects From: flavius.as@gmail.com (Flavius Aspra) I have a zval *obj holding an object of class B, which I then add to an array member of another object of class A. Then I create a new instance *obj2 of class B, to which I want to add a reference to *obj. How would I best go about it? So A works as a "pool" of B's, and B's may reference to each other. Please tell me key functions and macros to use to accomplish specifically this thing, as the API is quite new to me. I have thought about setting Z_SET_ISREF_P() manually, but what else would I need? From my understanding, I'd still need a new zval* for that. Any other better ways? Regards, Flavius