RE: [PECL-DEV] how to return an array of c++ objects

[email protected] ("John Hayes") Wed, 19 May 2010 17:03:59 -0400
Newsgroups php.pecl.dev
Message-ID <018101caf796$cd9e2910$68da7b30$@com>
Thanks Michael. I have tried that, and it had its own issues which I won't
go into. 

Turns out all I was missing was MAKE_STD_ZVAL(node_zval) before doing
object_init_ex(node_zval, node_ce) on it.
Furthermore, I have to do this for each loop iteration to keep from ending
up with an array full of the same object.

Thanks anyway. Please feel free to comment further if you think I'm actually
doing it the wrong way.

-----Original Message-----
From: Michael Maclean [mailto:[email protected]] 
Sent: Wednesday, May 19, 2010 4:46 PM
To: John Hayes
Cc: [email protected]
Subject: Re: [PECL-DEV] how to return an array of c++ objects

John Hayes wrote:

> (As you can see, the two-node long map is being traversed, the function
> exits, then the segfault.)

Have you tried getting a core dump and using gdb to get a backtrace?

In case you're not aware, try:

ulimit -c unlimited
php -r '$g = new Graph(); $g->getNodes();'
gdb /path/to/php/binary core

If you know that, ignore me :) It requires you to have build PHP with 
--enable-debug.

-- 
Cheers,
Michael
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.819 / Virus Database: 271.1.1/2855 - Release Date: 05/19/10
02:26:00