Hi Andrey,

----- Original Message -----
From: "Andrey Hristov"
Sent: Friday, April 25, 2008

>   Hi,
> [...]
> heh, this optimisitations was one of the pluses mysqlnd had over
> mysqli/libmysql. I am using the following macro:
>
> #if PHP_MAJOR_VERSION < 6
> #define mysqlnd_array_init(arg, field_count) \
> { \
> ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg));\
> zend_hash_init(Z_ARRVAL_P(arg), (field_count), NULL, ZVAL_PTR_DTOR, 0); \
> Z_TYPE_P(arg) = IS_ARRAY;\
> }
> #else
> #define mysqlnd_array_init(arg, field_count) \
> { \
> ALLOC_HASHTABLE_REL(Z_ARRVAL_P(arg));\
> zend_u_hash_init(Z_ARRVAL_P(arg), (field_count), NULL, ZVAL_PTR_DTOR,
> 0, 0);\
> Z_TYPE_P(arg) = IS_ARRAY;\
> }
> #endif
>

Ah yes, I see. :-)  Yeah, any of the database functions (in all DB exts.)
that create/return arrays are one of the obvious things I had in mind to
change, but hadn't come across your mysqlnd "workaround," heh.  Just knew
that plain array_init() is used in mysql/mysqli, pgsql, sqlite, etc...


- Matt


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to