phalcon/cphalcon — pull request #822 by sjinks (2013-07-11 03:49:12+00:00)
Title: kernel/array.c optimization

Changes:
* isset/unset/update/fetch functions are now more consistent with PHP's behavior (ie, they accept all scalar key types, properly handle string keys consisting of digits etc);
* use Zend's SEPARATE_ZVAL() macro;
* phalcon_array_{is,un}set() do not need a temporary zval anymore — -1 memory allocation, -1 type conversion
* phalcon_array_update_zval() and phalcon_array_fetch() do not zval need type conversions anymore;
* phalcon_array_fetch family does memory allocation in one place which makes it easier to find potential issues;
* replaced php_error_docref() with zend_error() — this is what SPL and new extensions prefer to use nowadays. The advantage is that zend_error() does not need TSRMLS_CC. Therefore on the next iteration we will be able to get rid of TSRMLS_CC in the array functions and this will allow to save some stack/registers, give more opportunities to inlining and give a bit faster code.

PS: optimizations resulted in -110 lines, less code to maintain for more features :grinning: