Re: how do you create a private property as an array in a class

From: Date: Sun, 08 Apr 2012 20:00:53 +0000
Subject: Re: how do you create a private property as an array in a class
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-59468@lists.php.net to get a copy of this message
On Sun, Apr 8, 2012 at 2:26 AM, Derick Rethans <derick@php.net> wrote: > On Sat, 7 Apr 2012, Matthew Hernandez wrote: > > > How can I valgrind my extension? Google isn't bringing up many php > > extension topics :/ > > On the shell: > > export USE_ZEND_ALLOC=0 > export ZEND_DONT_UNLOAD_MODULES=1 > valgrind php -dextension=yourextension.so yourscript.php > > See for some more info here: > http://derickrethans.nl/valgrinding-shared-modules.html thanks, this solved the seg fault issue in no time. > > > > I can't figure out why I keep getting a seg fault: > > > > typedef struct _foo_object { > > zend_object std; > > zval *elements; > > } foo_object; > > > > static foo_object *foo_object_ptr; > > You really want to avoid real globals like this though, as it makes > things not thread-safe. > thanks, I'll avoid doing it like this. Which reminds me. Would you happen to have a "best practices" for php-extension development that I could reference? I've found a few articles around, mostly out dated. > Also, please don't top-reply on this list. > sorry. > > cheers, > Derick > > -- > http://derickrethans.nl | > http://xdebug.org > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > twitter: @derickr and @xdebug >

« previous php.internals (#59468) next »