Re: having an exception instance
| From: | Gustavo Lopes | Date: | Wed, 16 May 2012 07:29:29 +0000 |
| Subject: | Re: having an exception instance | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60591@lists.php.net to get a copy of this message | ||
On Wed, 16 May 2012 05:45:05 +0200, Yader Hernandez <yader.hernandez@gmail.com> wrote:
I'm calling this function: static zend_class_entry *create_class_entry_runtime_exception(TSRMLS_C) {For the RuntimeException class entry, you can just include <ext/spl/spl_exceptions.h> and use spl_ce_RuntimeException. When the pointer is not exported, you can use zend_lookup_class_ex(). -- Gustavo Lopeszend_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.