# Private data requiring custom object creation error

- Thread: https://externals.io/message/22110
- Original archive: https://news-web.php.net/php.internals/22110
- Started by Andrew Mather BT Std on 2006-03-04T22:03:42+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #22110 — Andrew Mather BT Std — 2006-03-04T22:03:42+00:00

URL: https://externals.io/message/22110#22110

I'm working through George Schlossnagle's Advanced PHP Programming,
(which I'm happy to plug. Excellent).

Having successfully used C++ to generate extensions (per Jay Smith tutorial)
I am now checking out the facility to store custom objects - packaged private
data alongside the native zend object, per George S. example.

An example based closely on the example noted in the book, compiles fine,
but generates the following error and backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x0822d12b in zend_std_get_constructor (object=0x8459a48, tsrm_ls=0x835e018)
    at /src/php-5.1.1/Zend/zend_object_handlers.c:884
884             zend_function *constructor = zobj->ce->constructor;

If constructor was simply null, would not be an issue. Suggests either the 
object or object ce are inappropriate.

Any thoughts?

Cheers,

Andrew.

---

## #22111 — Marcus Boerger — 2006-03-04T22:13:19+00:00

URL: https://externals.io/message/22110#22111 · In reply to: #22110

Hello Andrew,

  you obviously rely on standard zend objects because you are using standard
zend handlers for yyour objects. To do so your object struct should start
with the standard zend object struct as nearly all overloaded ebjects in
current php do. In the constructor you now need to initialize at least the
ce, and properties table.

marcus

Saturday, March 4, 2006, 11:03:42 PM, you wrote:

> I'm working through George Schlossnagle's Advanced PHP Programming,
> (which I'm happy to plug. Excellent).

> Having successfully used C++ to generate extensions (per Jay Smith tutorial)
> I am now checking out the facility to store custom objects - packaged private
> data alongside the native zend object, per George S. example.

> An example based closely on the example noted in the book, compiles fine,
> but generates the following error and backtrace:

> Program received signal SIGSEGV, Segmentation fault.
> 0x0822d12b in zend_std_get_constructor (object=0x8459a48, tsrm_ls=0x835e018)
>     at /src/php-5.1.1/Zend/zend_object_handlers.c:884
> 884             zend_function *constructor = zobj->ce->constructor;

> If constructor was simply null, would not be an issue. Suggests either the 
> object or object ce are inappropriate.

> Any thoughts?

> Cheers,

> Andrew. 




Best regards,
 Marcus
