Re: php extension for lib Judy
| From: | Nicolas Brousse | Date: | Fri, 17 Sep 2010 05:17:48 +0000 |
| Subject: | Re: php extension for lib Judy | ||
| References: | 1 2 3 4 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-7645@lists.php.net to get a copy of this message | ||
On 9/16/10 3:05 AM, Antony Dovgal wrote:
> On 08/18/2010 03:27 PM, Nicolas Brousse wrote:
>> Hi,
>>
>> I'm writing you guys because I started to work on a PHP extension for
>> the lib Judy. I have most of the Judy API implemented but still have a
>> bunch of work to do to get something clean for php (like implementing
>> iterators methods, test the windows version, etc).
>>
>> I never did a php extension before, so any feedbacks are welcome :
>> http://github.com/orieg/php-judy#readme
>
> PHP_METHOD(judy, last_empty);
> PHP_METHOD(judy, prev_empty);
>
> AFAIK "camelCase" naming system is de-facto standard for PHP extensions,
> would be good to see these methods renamed to lastEmpty(), prevEmpty() and so on.
Gooid point. I just cleaned that.
> Also I don't quite see any point in calling methods with zend_call_method_with_X_params()
> if these very methods are defined several lines above - you can just move the body of the
> method to an internal function and call it directly, not through ZE API (that would also
> buy you some more performance).
I wasn't sure on this. At first, I thought it would make the code
cleaner/easier to read.
> You should also prevent calling __construct() several times, from what I can see atm it results
> in a memleak.
I'm not sure I understand this. Do you mean preventing the user from
doing $myobject->__construct() ?
Nicolas