RE: [PECL-DEV] how to return an array of c++ objects
| From: | John Hayes | Date: | Wed, 19 May 2010 21:03:59 +0000 |
| Subject: | RE: [PECL-DEV] how to return an array of c++ objects | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-7233@lists.php.net to get a copy of this message | ||
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:michael@no-surprises.co.uk]
Sent: Wednesday, May 19, 2010 4:46 PM
To: John Hayes
Cc: pecl-dev@lists.php.net
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