Re: [PHP-DEV] Segmentation Fault when trying to call zend_new_array.

2020-08-26 Thread Ivan Zanev
Thank you! On Wed, Aug 26, 2020 at 11:00 AM Alex wrote: > Dear Ivan, > > Some suggestions: > > - Build your own copy of the PHP embed library using ./configure > --enable-embed=shared or ./configure --enable-embed=static. Link against > that. > - If it doesn't work, get some already-working samp

Re: [PHP-DEV] Segmentation Fault when trying to call zend_new_array.

2020-08-26 Thread Alex
Dear Ivan, Some suggestions: - Build your own copy of the PHP embed library using ./configure --enable-embed=shared or ./configure --enable-embed=static. Link against that. - If it doesn't work, get some already-working sample code for use of the PHP embed SAPI and modify it rather than starting

Re: [PHP-DEV] Segmentation Fault when trying to call zend_new_array.

2020-08-26 Thread Ivan Zanev
Yes, it does. I recompiled php now with --configure --enable-embed=static and wrote a simple script: #include #include #include "sapi/embed/php_embed.h" int main(int argc, char *argv[]) { php_embed_init(argc, argv); HashTable *ht = zend_new_array(15); return 0; }

Re: [PHP-DEV] Segmentation Fault when trying to call zend_new_array.

2020-08-25 Thread Levi Morrison via internals
On Tue, Aug 25, 2020 at 5:31 AM Ivan Zanev wrote: > > Hello, > > I'm trying to learn a bit more about HashTable in PHP internally and how > memory is allocated when generating arrays with various sizes. I created a > simple C script that would call > > HashTable *ht = zend_new_array(15); > > Howev

[PHP-DEV] Segmentation Fault when trying to call zend_new_array.

2020-08-25 Thread Ivan Zanev
Hello, I'm trying to learn a bit more about HashTable in PHP internally and how memory is allocated when generating arrays with various sizes. I created a simple C script that would call HashTable *ht = zend_new_array(15); However, when I compile the script with gcc, I get segmentation fault; gd