Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60410 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46738 invoked from network); 2 May 2012 05:16:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 May 2012 05:16:37 -0000 Authentication-Results: pb1.pair.com header.from=yader.hernandez@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yader.hernandez@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: yader.hernandez@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-ob0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:60500] helo=mail-ob0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/E0-38165-433C0AF4 for ; Wed, 02 May 2012 01:16:36 -0400 Received: by obbuo13 with SMTP id uo13so501173obb.29 for ; Tue, 01 May 2012 22:16:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=bbAUD+cRDpteslNfWY/KTUcsYfBRZcV0L3rQw1AeHkg=; b=PEYa81bwRnq99Hgem0wB+bxpyfa7cBsVZnrBqdU5KpRyAMguUcykADtweo2o0gBoTF O9ck/4BabWJowsEI3y1aRs7ZeK1vedBmlgIoMSdLYKOwyntl7mwBWiYBYNCCoc8TRjqJ 1leJWBTRZgGF9nyQpBc0NOCu8FosLClbHImqv7vQ1Io6erO3i86UieutOcHRhrkjZBHb 5dRjrqVWl5rrTcZfyYJYshM1h3y5bYVUhCLH9e6KhmSsFurOJxocxVvuBaG5Qn4vtEx2 mJhMOa4xxgfPZIyxrsPS8RDoWVjsrkREIs9hFC5sWXXAWzPzeMAex0CoQbA9ufRNWm79 gkyw== MIME-Version: 1.0 Received: by 10.182.5.169 with SMTP id t9mr12862531obt.57.1335935793496; Tue, 01 May 2012 22:16:33 -0700 (PDT) Received: by 10.60.147.199 with HTTP; Tue, 1 May 2012 22:16:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 1 May 2012 22:16:33 -0700 Message-ID: To: PHP Developers Mailing List Content-Type: multipart/alternative; boundary=f46d0447979b6a022004bf06ca78 Subject: Re: how to instantiate new object From: yader.hernandez@gmail.com (Yader Hernandez) --f46d0447979b6a022004bf06ca78 Content-Type: text/plain; charset=ISO-8859-1 On Tue, May 1, 2012 at 8:46 PM, Yader Hernandez wrote: > Hello, > > I was wondering how to create a new object from a function call? > > By this I mean if I call foo() from a script, that should return a new > instance of an object. If I call foo() again, it should be a new instance > of an object as well. > > I haven't been able to find any good examples from the code I've been > reading. > > Does anyone know of a good place to find an example? > > thanks > To be a little clearer I mean that in my extension, I can call my custom object. So any calls from a script will be able to do $o = new Foo(). I registered my struct in zend_objects_store_put, so I understand how the instantiate is happening. But now I'm implementing a ZEND_METHOD that requires a new instance of Foo and I've been stuck for a few days trying to find a nice clean example. I was wondering if someone knew of a good place look into? thanks --f46d0447979b6a022004bf06ca78--