本文整理汇总了C++中zephir_fast_count_int函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_fast_count_int函数的具体用法?C++ zephir_fast_count_int怎么用?C++ zephir_fast_count_int使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zephir_fast_count_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
PHP_METHOD(Test_Vars, testCountOptimizerVarDumpAndExport) {
zval *testVar, testVar_sub, _0, _1;
zval this_zv;
zval *this_ptr = getThis();
if (EXPECTED(this_ptr)) {
ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr));
this_ptr = &this_zv;
} else this_ptr = NULL;
ZVAL_UNDEF(&testVar_sub);
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &testVar);
ZEPHIR_INIT_VAR(&_0);
ZEPHIR_INIT_NVAR(&_0);
ZVAL_LONG(&_0, zephir_fast_count_int(testVar TSRMLS_CC));
zephir_var_dump(&_0 TSRMLS_CC);
ZEPHIR_INIT_VAR(&_1);
ZEPHIR_INIT_NVAR(&_1);
ZVAL_LONG(&_1, zephir_fast_count_int(testVar TSRMLS_CC));
zephir_var_export(&_1 TSRMLS_CC);
ZEPHIR_MM_RESTORE();
}
示例2: PHP_METHOD
/**
* Phalcon\Mvc\Model\ValidationFailed constructor
*
* @param Model model
* @param Message[] validationMessages
*/
PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, __construct) {
int ZEPHIR_LAST_CALL_STATUS;
zval *validationMessages = NULL;
zval *model, *validationMessages_param = NULL, *messageStr = NULL, *message = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &model, &validationMessages_param);
validationMessages = validationMessages_param;
if (zephir_fast_count_int(validationMessages TSRMLS_CC) > 0) {
ZEPHIR_OBS_VAR(message);
zephir_array_fetch_long(&message, validationMessages, 0, PH_NOISY, "phalcon/mvc/model/validationfailed.zep", 51 TSRMLS_CC);
ZEPHIR_CALL_METHOD(&messageStr, message, "getmessage", NULL, 0);
zephir_check_call_status();
} else {
ZEPHIR_INIT_NVAR(messageStr);
ZVAL_STRING(messageStr, "Validation failed", 1);
}
zephir_update_property_this(this_ptr, SL("_model"), model TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("_messages"), validationMessages TSRMLS_CC);
ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_validationfailed_ce, this_ptr, "__construct", NULL, 0, messageStr);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
示例3: PHP_METHOD
/**
* Fetch a YAML payload from the Beanstalkd server
*/
PHP_METHOD(Phalcon_Queue_Beanstalk, readYaml) {
zval *response = NULL, *status = NULL, *numberOfBytes = NULL, *data = NULL;
int ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_MM_GROW();
ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 382);
zephir_check_call_status();
ZEPHIR_OBS_VAR(status);
zephir_array_fetch_long(&status, response, 0, PH_NOISY, "phalcon/queue/beanstalk.zep", 329 TSRMLS_CC);
if (zephir_fast_count_int(response TSRMLS_CC) > 1) {
ZEPHIR_OBS_VAR(numberOfBytes);
zephir_array_fetch_long(&numberOfBytes, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 332 TSRMLS_CC);
ZEPHIR_CALL_METHOD(&response, this_ptr, "read", NULL, 0);
zephir_check_call_status();
ZEPHIR_CALL_FUNCTION(&data, "yaml_parse", NULL, 385, response);
zephir_check_call_status();
} else {
ZEPHIR_INIT_NVAR(numberOfBytes);
ZVAL_LONG(numberOfBytes, 0);
ZEPHIR_INIT_NVAR(data);
array_init(data);
}
zephir_create_array(return_value, 3, 0 TSRMLS_CC);
zephir_array_fast_append(return_value, status);
zephir_array_fast_append(return_value, numberOfBytes);
zephir_array_fast_append(return_value, data);
RETURN_MM();
}
示例4: PHP_METHOD
/**
* Mounts a group of routes in the router
*
* @param Test\Router\Group route
* @return Test\Router
*/
PHP_METHOD(Test_Router, mount) {
HashTable *_1, *_4;
HashPosition _0, _3;
int ZEPHIR_LAST_CALL_STATUS;
zval *group, *groupRoutes = NULL, *beforeMatch = NULL, *hostname = NULL, *routes, *route = NULL, **_2, **_5, *_6;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &group);
if (Z_TYPE_P(group) != IS_OBJECT) {
ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The group of routes is not valid");
return;
}
ZEPHIR_CALL_METHOD(&groupRoutes, group, "getroutes", NULL);
zephir_check_call_status();
if (!(zephir_fast_count_int(groupRoutes TSRMLS_CC))) {
ZEPHIR_THROW_EXCEPTION_STR(test_router_exception_ce, "The group of routes does not contain any routes");
return;
}
ZEPHIR_CALL_METHOD(&beforeMatch, group, "getbeforematch", NULL);
zephir_check_call_status();
if (Z_TYPE_P(beforeMatch) != IS_NULL) {
zephir_is_iterable(groupRoutes, &_1, &_0, 0, 0);
for (
; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS
; zephir_hash_move_forward_ex(_1, &_0)
) {
ZEPHIR_GET_HVALUE(route, _2);
ZEPHIR_CALL_METHOD(NULL, route, "beforematch", NULL, beforeMatch);
zephir_check_call_status();
}
}
ZEPHIR_CALL_METHOD(&hostname, group, "gethostname", NULL);
zephir_check_call_status();
if (Z_TYPE_P(hostname) != IS_NULL) {
zephir_is_iterable(groupRoutes, &_4, &_3, 0, 0);
for (
; zephir_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS
; zephir_hash_move_forward_ex(_4, &_3)
) {
ZEPHIR_GET_HVALUE(route, _5);
ZEPHIR_CALL_METHOD(NULL, route, "sethostname", NULL, hostname);
zephir_check_call_status();
}
}
ZEPHIR_OBS_VAR(routes);
zephir_read_property_this(&routes, this_ptr, SL("_routes"), PH_NOISY_CC);
if (Z_TYPE_P(routes) == IS_ARRAY) {
ZEPHIR_INIT_VAR(_6);
zephir_fast_array_merge(_6, &(routes), &(groupRoutes) TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("_routes"), _6 TSRMLS_CC);
} else {
zephir_update_property_this(this_ptr, SL("_routes"), groupRoutes TSRMLS_CC);
}
RETURN_THIS();
}
示例5: PHP_METHOD
/**
* Length filter. If an array/object is passed a count is performed otherwise a strlen/mb_strlen
*/
PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) {
zend_bool _0;
int ZEPHIR_LAST_CALL_STATUS;
zval *item;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &item);
_0 = Z_TYPE_P(item) == IS_OBJECT;
if (!(_0)) {
_0 = Z_TYPE_P(item) == IS_ARRAY;
}
if (_0) {
RETURN_MM_LONG(zephir_fast_count_int(item TSRMLS_CC));
}
if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) {
ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 380, item);
zephir_check_call_status();
RETURN_MM();
}
RETURN_MM_LONG(zephir_fast_strlen_ev(item));
}
示例6: PHP_METHOD
/**
* Sets the path for a domain
*
* @return string
*/
PHP_METHOD(Phalcon_Translate_Adapter_Gettext, setDirectory) {
int ZEPHIR_LAST_CALL_STATUS;
HashTable *_1;
HashPosition _0;
zval *directory, *key = NULL, *value = NULL, **_2, *_3 = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &directory);
zephir_update_property_this(this_ptr, SL("_directory"), directory TSRMLS_CC);
if (Z_TYPE_P(directory) == IS_ARRAY) {
if (zephir_fast_count_int(directory TSRMLS_CC)) {
zephir_is_iterable(directory, &_1, &_0, 0, 0, "phalcon/translate/adapter/gettext.zep", 188);
for (
; zephir_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS
; zephir_hash_move_forward_ex(_1, &_0)
) {
ZEPHIR_GET_HMKEY(key, _1, _0);
ZEPHIR_GET_HVALUE(value, _2);
ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", NULL, key, value);
zephir_check_call_status();
}
}
} else {
ZEPHIR_CALL_METHOD(&_3, this_ptr, "getdefaultdomain", NULL);
zephir_check_call_status();
ZEPHIR_CALL_FUNCTION(NULL, "bindtextdomain", NULL, _3, directory);
zephir_check_call_status();
}
ZEPHIR_MM_RESTORE();
}
示例7: PHP_METHOD
/**
* Length filter. If an array/object is passed a count is performed otherwise a strlen/mb_strlen
*/
PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) {
int ZEPHIR_LAST_CALL_STATUS;
zend_bool _0;
zval *item, *length = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &item);
ZEPHIR_INIT_VAR(length);
ZVAL_LONG(length, 0);
_0 = Z_TYPE_P(item) == IS_OBJECT;
if (!(_0)) {
_0 = Z_TYPE_P(item) == IS_ARRAY;
}
if (_0) {
ZEPHIR_INIT_NVAR(length);
ZVAL_LONG(length, zephir_fast_count_int(item TSRMLS_CC));
} else {
if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) {
ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 366, item);
zephir_check_call_status();
} else {
ZEPHIR_INIT_NVAR(length);
ZVAL_LONG(length, zephir_fast_strlen_ev(item));
}
}
RETURN_CCTOR(length);
}
示例8: PHP_METHOD
/**
* 检查数组是否包含 Associative 键?
*
* @param array arr
* @param bool reusingKeys
* @return bool
*/
PHP_METHOD(DotPHP_Utils_ArrayUtil, isAssoc) {
int ZEPHIR_LAST_CALL_STATUS;
zend_bool reusingKeys;
zval *arr_param = NULL, *reusingKeys_param = NULL, *r = NULL, _0, _1, *_2, *_3;
zval *arr = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &arr_param, &reusingKeys_param);
zephir_get_arrval(arr, arr_param);
if (!reusingKeys_param) {
reusingKeys = 0;
} else {
reusingKeys = zephir_get_boolval(reusingKeys_param);
}
ZEPHIR_SINIT_VAR(_0);
ZVAL_LONG(&_0, 0);
ZEPHIR_SINIT_VAR(_1);
ZVAL_LONG(&_1, (zephir_fast_count_int(arr TSRMLS_CC) - 1));
ZEPHIR_CALL_FUNCTION(&r, "range", NULL, 24, &_0, &_1);
zephir_check_call_status();
ZEPHIR_INIT_VAR(_2);
if (reusingKeys) {
ZVAL_BOOL(_2, !ZEPHIR_IS_IDENTICAL(arr, r));
} else {
ZEPHIR_INIT_VAR(_3);
zephir_array_keys(_3, arr TSRMLS_CC);
ZVAL_BOOL(_2, !ZEPHIR_IS_IDENTICAL(_3, r));
}
RETURN_CCTOR(_2);
}
示例9: PHP_METHOD
/**
* Removes transactions from the TransactionManager
*/
PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, _collectTransaction) {
HashTable *_1$$3;
HashPosition _0$$3;
zval *transaction, *transactions = NULL, *newTransactions = NULL, *managedTransaction = NULL, **_2$$3;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &transaction);
ZEPHIR_OBS_VAR(transactions);
zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC);
if (zephir_fast_count_int(transactions TSRMLS_CC)) {
ZEPHIR_INIT_VAR(newTransactions);
array_init(newTransactions);
zephir_is_iterable(transactions, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/transaction/manager.zep", 295);
for (
; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS
; zend_hash_move_forward_ex(_1$$3, &_0$$3)
) {
ZEPHIR_GET_HVALUE(managedTransaction, _2$$3);
if (!ZEPHIR_IS_EQUAL(managedTransaction, transaction)) {
zephir_array_append(&newTransactions, transaction, PH_SEPARATE, "phalcon/mvc/model/transaction/manager.zep", 289);
} else {
RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_number") TSRMLS_CC));
}
}
zephir_update_property_this(getThis(), SL("_transactions"), newTransactions TSRMLS_CC);
}
ZEPHIR_MM_RESTORE();
}
示例10: PHP_METHOD
/**
* @inheritdoc
*/
PHP_METHOD(Owl_Log_AbstractWriter, commit) {
int ZEPHIR_LAST_CALL_STATUS;
zval *records_param = NULL, *_0, *_1, *_2 = NULL, *_3, *_4;
zval *records = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &records_param);
zephir_get_arrval(records, records_param);
ZEPHIR_INIT_VAR(_0);
_1 = zephir_fetch_nproperty_this(this_ptr, SL("records"), PH_NOISY_CC);
ZEPHIR_CALL_METHOD(&_2, this_ptr, "filterrecords", NULL, 0, records);
zephir_check_call_status();
zephir_fast_array_merge(_0, &(_1), &(_2) TSRMLS_CC);
zephir_update_property_this(this_ptr, SL("records"), _0 TSRMLS_CC);
_3 = zephir_fetch_nproperty_this(this_ptr, SL("records"), PH_NOISY_CC);
_4 = zephir_fetch_nproperty_this(this_ptr, SL("recordsInterval"), PH_NOISY_CC);
if (ZEPHIR_LE_LONG(_4, zephir_fast_count_int(_3 TSRMLS_CC))) {
ZEPHIR_CALL_METHOD(NULL, this_ptr, "push", NULL, 0);
zephir_check_call_status();
}
ZEPHIR_MM_RESTORE();
}
示例11: PHP_METHOD
/**
* {@inheritDoc}
*/
PHP_METHOD(Owl_Std_Collection_ArrayCollection, count) {
zval *_0;
_0 = zephir_fetch_nproperty_this(this_ptr, SL("elements"), PH_NOISY_CC);
RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));
}
示例12: PHP_METHOD
/**
* Checks whether there are messages attached to the element
*/
PHP_METHOD(Phalcon_Forms_Element, hasMessages) {
zval *_0;
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC);
RETURN_BOOL(zephir_fast_count_int(_0 TSRMLS_CC) > 0);
}
示例13: PHP_METHOD
/**
* Defined by Countable interface
*
* @return int
*/
PHP_METHOD(Yaf_Session, count) {
zval *_0;
_0 = zephir_fetch_nproperty_this(this_ptr, SL("session"), PH_NOISY_CC);
RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));
}
示例14: PHP_METHOD
/**
* Returns the number of annotations in the collection
*/
PHP_METHOD(Phalcon_Annotations_Collection, count) {
zval *_0;
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotations"), PH_NOISY_CC);
RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));
}
示例15: PHP_METHOD
/**
* Checks how many elements are in the register
*/
PHP_METHOD(Phalcon_Registry, count) {
zval *_0;
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC);
RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC));
}