Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60591 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44350 invoked from network); 16 May 2012 07:29:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 May 2012 07:29:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:47039] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D6/AC-28418-E5753BF4 for ; Wed, 16 May 2012 03:29:35 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id F216D70003DD; Wed, 16 May 2012 08:29:31 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id RnOwyh1ZeyuK; Wed, 16 May 2012 08:29:31 +0100 (WEST) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 88B2B70003DC; Wed, 16 May 2012 08:29:31 +0100 (WEST) Received: from slws007.slhq.int (a82-161-209-109.adsl.xs4all.nl [82.161.209.109]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 3D18B200BB68; Wed, 16 May 2012 08:29:31 +0100 (WEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "PHP Developers Mailing List" , "Yader Hernandez" References: Date: Wed, 16 May 2012 09:29:29 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: User-Agent: Opera Mail/11.62 (Win32) Subject: Re: [PHP-DEV] having an exception instance From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Wed, 16 May 2012 05:45:05 +0200, Yader Hernandez wrote: > I'm calling this function: > > static zend_class_entry *create_class_entry_runtime_exception(TSRMLS_C) { > zend_class_entry **pce; > > if (zend_hash_find(CG(class_table), "runtimeexception", > sizeof("RuntimeException"), (void **) &pce) == SUCCESS) { > return *pce; > } > } > > but it's causing a segfault. > > The function is being called in PHP_MINIT_FUNCTION and assigning the > return value to a static zend_class_entry *runtime_exception_ptr > > My final goal is to be able to easily call zend_throw_exception and > pass runtime_exception_ptr pointer. For the RuntimeException class entry, you can just include and use spl_ce_RuntimeException. When the pointer is not exported, you can use zend_lookup_class_ex(). -- Gustavo Lopes