Re: [PHP4BETA] Extending PHP, Zend API

From: Date: Mon, 06 Mar 2000 23:42:14 +0000
Subject: Re: [PHP4BETA] Extending PHP, Zend API
References: 1 2  Groups: php.version4 
Request: Send a blank email to php-version4+get-11652@lists.php.net to get a copy of this message
Well ... that's how I got it to the point that I did. But there's next to no comments, and I could find no examples of the functions that I need to perform in other extensions. Actually, I *did* ask for help, but my query to this list went completely ignored, so I just shrugged, and kept at it until I made it work. But since I've got your attention, here's a few of questions: I need to call my external function like so -- $rv = loco($name, $return_array); $return_array is the destination for an abitrarily large and arbitrarily complex array of ints, floats, and arrays, and is built recursively. How does one create an array, and add elements to it? (or, perjaps I should say, how does one do it *correctly* <g>) ====================== Why do the API calls (such as zend_hash_find and zend_hash_update) sometimes want strlen(name) + 1, and other times want strlen(name) ? ============================ How can I get access to __LINE__ inside my module? zend_get_constant("__LINE__", sizeof("__LINE__"), &cdata) seems to work, but then comes back with nonsensical numbers sometimes. ============================== Since I do have this working, but suspect problems, what's the best procedure for testing for memory leaks or other problems? I see various messages in the Apache log from zend_variables.c complaining of overruns and Magic Numbers not being as expected (I assume). What precisely do these messages mean, and how would I go about tracking down the problems? Here's one: --------------------------------------- zend_opcode.c(172) : Block 0x081D2128 status: zend_variables.c(63) : Actual location (location was relayed) Beginning: Overrun (magic=0x00050100, expected=0x7312F8DC) End: Unknown ==================================== Any help would be greatly appreciated. I'll have something pretty cool to contribute later, but first I need to have it bulletproof. Paul Andi Gutmans wrote: > At 03:02 PM 3/6/00 -0500, Paul S. Gumerman wrote: > >Andi, > > > >When might this documentation be available? I need it badly ... I've built an > >extension module, and it works, but I'm certain that its buggy due to my not > >understanding the Zend API. > > It will take some time for it to be ready. You should probably learn from > the simple examples in ext/standard and move onto modules such as ext/mysql > for the more advanced stuff. In any case, you can ask people for help if > you get stuck. > > Andi > --- > Andi Gutmans <andi@zend.com> > http://www.zend.com/ > > ------------------------------------------------------------------------- > This email server is running an evaluation copy of the MailShield anti- > spam software. Please contact your email administrator if you have any > questions about this message. MailShield product info: www.mailshield.com

« previous php.version4 (#11652) next »