Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23113 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16070 invoked by uid 1010); 3 May 2006 07:59:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16054 invoked from network); 3 May 2006 07:59:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2006 07:59:44 -0000 X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:43800] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 39/D0-04906-71E58544 for ; Wed, 03 May 2006 03:39:03 -0400 Received: from baumbart.mbo (dslb-084-063-048-057.pools.arcor-ip.net [84.63.48.57]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id B599235C1C8; Wed, 3 May 2006 09:38:58 +0200 (CEST) Date: Wed, 3 May 2006 09:39:02 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <10810599259.20060503093902@marcus-boerger.de> To: Brandon Fosdick Cc: internals@lists.php.net In-Reply-To: <44584CA9.2040609@bfoz.net> References: <44584CA9.2040609@bfoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] zend_class_entry.create_object From: helly@php.net (Marcus Boerger) Hello Brandon, create_object is your new handler that is supposed to deliver an empty object. You cannot have this NULL. The __construct part allows to define what the actual constructor does afterwards. Forcing __construct to be called is a bit more complicated but a bunch of exts already do so. Check out pdo on that. regards marcus Wednesday, May 3, 2006, 8:24:41 AM, you wrote: > When registering a new class, what are the consequences of setting > zend_class_entry.create_object = NULL? INIT_CLASS_ENTRY() defaults it to > NULL, but the tutorial I'm looking at sets it to the address of a function immediately afterwards. > My concern is that setting this allows the engine to call a > constructor-like-function behind my back. I'd rather handle such things > while handling calls to new(). Is that possible? Is it even a good idea? > The tutorial code provides a function for zend_class_entry.create_object > that returns a populated zend_object_value. Presumably that's a useful > thing to do, and if I don't have a function there I would need to find > some other means of supplying the zend_object_value to the engine. Can I do that in a new() handler? How? Best regards, Marcus