本文整理汇总了C++中zephir_array_fast_append函数的典型用法代码示例。如果您正苦于以下问题:C++ zephir_array_fast_append函数的具体用法?C++ zephir_array_fast_append怎么用?C++ zephir_array_fast_append使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zephir_array_fast_append函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
PHP_METHOD(Xpl_ClassLoader, register) {
zval *_0;
int ZEPHIR_LAST_CALL_STATUS;
zval *prepend_param = NULL, *_1, _2;
zend_bool prepend;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 0, 1, &prepend_param);
if (!prepend_param) {
prepend = 0;
} else {
prepend = zephir_get_boolval(prepend_param);
}
ZEPHIR_INIT_VAR(_0);
zephir_create_array(_0, 2, 0 TSRMLS_CC);
zephir_array_fast_append(_0, this_ptr);
ZEPHIR_INIT_VAR(_1);
ZVAL_STRING(_1, "loadClass", 1);
zephir_array_fast_append(_0, _1);
ZEPHIR_SINIT_VAR(_2);
ZVAL_BOOL(&_2, (prepend ? 1 : 0));
ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 53, _0, ZEPHIR_GLOBAL(global_true), &_2);
zephir_check_call_status();
ZEPHIR_MM_RESTORE();
}
示例2: PHP_METHOD
/**
* Area where the version number is set. The format is as follows:
* ABBCCDE
*
* A - Major version
* B - Med version (two digits)
* C - Min version (two digits)
* D - Special release: 1 = Alpha, 2 = Beta, 3 = RC, 4 = Stable
* E - Special release version i.e. RC1, Beta2 etc.
*/
PHP_METHOD(Phalcon_Version, _getVersion) {
zval *_0 = NULL;
ZEPHIR_MM_GROW();
zephir_create_array(return_value, 5, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(_0);
ZVAL_LONG(_0, 3);
zephir_array_fast_append(return_value, _0);
ZEPHIR_INIT_NVAR(_0);
ZVAL_LONG(_0, 0);
zephir_array_fast_append(return_value, _0);
ZEPHIR_INIT_NVAR(_0);
ZVAL_LONG(_0, 2);
zephir_array_fast_append(return_value, _0);
ZEPHIR_INIT_NVAR(_0);
ZVAL_LONG(_0, 4);
zephir_array_fast_append(return_value, _0);
ZEPHIR_INIT_NVAR(_0);
ZVAL_LONG(_0, 0);
zephir_array_fast_append(return_value, _0);
RETURN_MM();
}
示例3: zephir_init_static_properties_Test_Properties_StaticPropertyArray
void zephir_init_static_properties_Test_Properties_StaticPropertyArray(TSRMLS_D) {
zval _1;
zval _0;
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(&_0);
zephir_create_array(&_0, 4, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(&_1);
ZVAL_LONG(&_1, 1);
zephir_array_fast_append(&_0, &_1);
ZEPHIR_INIT_NVAR(&_1);
ZVAL_LONG(&_1, 2);
zephir_array_fast_append(&_0, &_1);
ZEPHIR_INIT_NVAR(&_1);
ZVAL_LONG(&_1, 3);
zephir_array_fast_append(&_0, &_1);
ZEPHIR_INIT_NVAR(&_1);
ZVAL_LONG(&_1, 4);
zephir_array_fast_append(&_0, &_1);
zend_update_static_property(test_properties_staticpropertyarray_ce, ZEND_STRL("someArray"), &_0);
ZEPHIR_INIT_NVAR(&_1);
array_init(&_1);
zend_update_static_property(test_properties_staticpropertyarray_ce, ZEND_STRL("someEmptyArray"), &_1);
ZEPHIR_MM_RESTORE();
}
示例4: PHP_METHOD
PHP_METHOD(Test_NativeArray, testArray12) {
zval *a, *b, *c, *_0;
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(a);
array_init_size(a, 5);
ZEPHIR_INIT_VAR(_0);
ZVAL_LONG(_0, 1);
zephir_array_fast_append(a, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 2);
zephir_array_fast_append(a, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 3);
zephir_array_fast_append(a, _0);
ZEPHIR_INIT_VAR(b);
array_init_size(b, 2);
zephir_array_fast_append(b, a);
ZEPHIR_INIT_VAR(c);
array_init_size(c, 2);
zephir_array_fast_append(c, b);
RETURN_CCTOR(c);
}
示例5: PHP_METHOD
/**
* Adds a variable to the debug output
*/
PHP_METHOD(Phalcon_Debug, debugVar) {
zval *_0;
int ZEPHIR_LAST_CALL_STATUS;
zval *key = NULL;
zval *varz, *key_param = NULL, *_1 = NULL, *_2;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &varz, &key_param);
if (!key_param) {
ZEPHIR_INIT_VAR(key);
ZVAL_EMPTY_STRING(key);
} else {
zephir_get_strval(key, key_param);
}
ZEPHIR_INIT_VAR(_0);
zephir_create_array(_0, 3, 0 TSRMLS_CC);
zephir_array_fast_append(_0, varz);
ZEPHIR_CALL_FUNCTION(&_1, "debug_backtrace", NULL, 157);
zephir_check_call_status();
zephir_array_fast_append(_0, _1);
ZEPHIR_INIT_VAR(_2);
zephir_time(_2);
zephir_array_fast_append(_0, _2);
zephir_update_property_array_append(this_ptr, SL("_data"), _0 TSRMLS_CC);
RETURN_THIS();
}
示例6: PHP_METHOD
PHP_METHOD(Test_Flow, testFor3) {
HashTable *_2;
HashPosition _1;
zval *v = NULL, *b, *c, *_0, **_3;
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(c);
array_init(c);
ZEPHIR_INIT_VAR(b);
array_init_size(b, 5);
ZEPHIR_INIT_VAR(_0);
ZVAL_LONG(_0, 1);
zephir_array_fast_append(b, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 2);
zephir_array_fast_append(b, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 3);
zephir_array_fast_append(b, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 4);
zephir_array_fast_append(b, _0);
zephir_is_iterable(b, &_2, &_1, 0, 1);
for (
; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
; zend_hash_move_backwards_ex(_2, &_1)
) {
ZEPHIR_GET_HVALUE(v, _3);
zephir_array_append(&c, v, PH_SEPARATE);
}
RETURN_CCTOR(c);
}
示例7: PHP_METHOD
PHP_METHOD(Test_NativeArray, testArrayAccess3) {
long c = 0;
zval a, b, _0;
zval *this_ptr = getThis();
ZVAL_UNDEF(&a);
ZVAL_UNDEF(&b);
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(&a);
zephir_create_array(&a, 3, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(&_0);
ZVAL_LONG(&_0, 1);
zephir_array_fast_append(&a, &_0);
ZEPHIR_INIT_NVAR(&_0);
ZVAL_LONG(&_0, 2);
zephir_array_fast_append(&a, &_0);
ZEPHIR_INIT_NVAR(&_0);
ZVAL_LONG(&_0, 3);
zephir_array_fast_append(&a, &_0);
c = 0;
zephir_array_fetch_long(&b, &a, c, PH_NOISY | PH_READONLY, "test/nativearray.zep", 267 TSRMLS_CC);
RETURN_CTOR(&b);
}
示例8: 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();
}
示例9: PHP_METHOD
/**
* Alias of variables() method
*
* @param mixed variable
* @param ...
*/
PHP_METHOD(Phalcon_Debug_Dump, all) {
zval _1;
zval _0;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_0);
ZVAL_UNDEF(&_1);
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(&_0);
zephir_create_array(&_0, 2, 0 TSRMLS_CC);
zephir_array_fast_append(&_0, this_ptr);
ZEPHIR_INIT_VAR(&_1);
ZVAL_STRING(&_1, "variables");
zephir_array_fast_append(&_0, &_1);
ZEPHIR_INIT_NVAR(&_1);
zephir_get_args(&_1);
ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0, &_1);
zephir_check_call_status();
RETURN_MM();
}
示例10: PHP_METHOD
PHP_METHOD(PhalconPlus_Enum_Sys, getGlobalConfigDir) {
zval *_3;
zval *_1, *_2, _4;
zval *_0;
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(_0);
zephir_create_array(_0, 3, 0 TSRMLS_CC);
ZEPHIR_OBS_VAR(_1);
zephir_read_static_property_ce(&_1, phalconplus_enum_sys_ce, SL("rootDir") TSRMLS_CC);
zephir_array_fast_append(_0, _1);
ZEPHIR_INIT_VAR(_2);
ZVAL_STRING(_2, "common", 1);
zephir_array_fast_append(_0, _2);
ZEPHIR_INIT_VAR(_3);
ZEPHIR_CONCAT_SS(_3, "config", ".php");
zephir_array_fast_append(_0, _3);
ZEPHIR_SINIT_VAR(_4);
ZVAL_STRING(&_4, "/", 0);
zephir_fast_join(return_value, &_4, _0 TSRMLS_CC);
RETURN_MM();
}
示例11: PHP_METHOD
/**
* Adds a resource to the annotations handler
* A resource is a class that contains routing annotations
* The class is located in a module
*/
PHP_METHOD(Phalcon_Mvc_Router_Annotations, addModuleResource) {
zval *_0;
zval *module_param = NULL, *handler_param = NULL, *prefix_param = NULL;
zval *module = NULL, *handler = NULL, *prefix = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 1, &module_param, &handler_param, &prefix_param);
if (unlikely(Z_TYPE_P(module_param) != IS_STRING && Z_TYPE_P(module_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'module' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(module_param) == IS_STRING)) {
zephir_get_strval(module, module_param);
} else {
ZEPHIR_INIT_VAR(module);
ZVAL_EMPTY_STRING(module);
}
if (unlikely(Z_TYPE_P(handler_param) != IS_STRING && Z_TYPE_P(handler_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(handler_param) == IS_STRING)) {
zephir_get_strval(handler, handler_param);
} else {
ZEPHIR_INIT_VAR(handler);
ZVAL_EMPTY_STRING(handler);
}
if (!prefix_param) {
ZEPHIR_INIT_VAR(prefix);
ZVAL_EMPTY_STRING(prefix);
} else {
if (unlikely(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(prefix_param) == IS_STRING)) {
zephir_get_strval(prefix, prefix_param);
} else {
ZEPHIR_INIT_VAR(prefix);
ZVAL_EMPTY_STRING(prefix);
}
}
ZEPHIR_INIT_VAR(_0);
zephir_create_array(_0, 3, 0 TSRMLS_CC);
zephir_array_fast_append(_0, prefix);
zephir_array_fast_append(_0, handler);
zephir_array_fast_append(_0, module);
zephir_update_property_array_append(this_ptr, SL("_handlers"), _0 TSRMLS_CC);
if (0) {
zephir_update_property_this(this_ptr, SL("_processed"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC);
} else {
zephir_update_property_this(this_ptr, SL("_processed"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC);
}
RETURN_THIS();
}
示例12: PHP_METHOD
PHP_METHOD(Test_Pregmatch, testMatchAllInZep) {
zval m1, m2, _0;
zephir_fcall_cache_entry *_1 = NULL;
int ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_INIT_THIS();
ZVAL_UNDEF(&m1);
ZVAL_UNDEF(&m2);
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
ZVAL_LONG(&_0, 1);
ZEPHIR_CALL_METHOD(&m1, this_ptr, "testmatchall", &_1, 0, &_0);
zephir_check_call_status();
ZVAL_LONG(&_0, 2);
ZEPHIR_CALL_METHOD(&m2, this_ptr, "testmatchall", &_1, 0, &_0);
zephir_check_call_status();
zephir_create_array(return_value, 2, 0 TSRMLS_CC);
zephir_array_fast_append(return_value, &m1);
zephir_array_fast_append(return_value, &m2);
RETURN_MM();
}
示例13: PHP_METHOD
PHP_METHOD(Test_Fibonnaci, fibArray2) {
int i = 0, n = 0;
zval *fib = NULL, *_0 = NULL, *_1$$3, *_2$$3, *_3$$3 = NULL;
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(fib);
zephir_create_array(fib, 2, 0 TSRMLS_CC);
ZEPHIR_INIT_VAR(_0);
ZVAL_LONG(_0, 0);
zephir_array_fast_append(fib, _0);
ZEPHIR_INIT_NVAR(_0);
ZVAL_LONG(_0, 1);
zephir_array_fast_append(fib, _0);
i = 2;
n = 10;
while (1) {
if (!(i < n)) {
break;
}
zephir_array_fetch_long(&_1$$3, fib, (i - 1), PH_NOISY | PH_READONLY, "test/fibonnaci.zep", 67 TSRMLS_CC);
zephir_array_fetch_long(&_2$$3, fib, (i - 2), PH_NOISY | PH_READONLY, "test/fibonnaci.zep", 67 TSRMLS_CC);
ZEPHIR_INIT_LNVAR(_3$$3);
zephir_add_function(_3$$3, _1$$3, _2$$3);
zephir_array_update_long(&fib, i, &_3$$3, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY);
i++;
}
RETURN_CCTOR(fib);
}
示例14: PHP_METHOD
PHP_METHOD(Test_Json, testEncodeOptions) {
zval *arr, *_0 = NULL, _1;
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(arr);
array_init_size(arr, 7);
ZEPHIR_INIT_VAR(_0);
ZVAL_STRING(_0, "<foo>", 1);
zephir_array_fast_append(arr, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_STRING(_0, "'bar'", 1);
zephir_array_fast_append(arr, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_STRING(_0, "&blong&", 1);
zephir_array_fast_append(arr, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_STRING(_0, "\xc3\xa9", 1);
zephir_array_fast_append(arr, _0);
ZEPHIR_SINIT_VAR(_1);
ZVAL_LONG(&_1, 1);
zephir_json_encode(return_value, &(return_value), arr, zephir_get_intval(&_1) TSRMLS_CC);
RETURN_MM();
}
示例15: PHP_METHOD
/**
* Commits the transaction
*/
PHP_METHOD(Phalcon_Mvc_Model_Transaction, commit) {
zval *_1$$3, *_3$$3;
zval *manager = NULL, *_4, *_0$$3, *_2$$3;
int ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_MM_GROW();
ZEPHIR_OBS_VAR(manager);
zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC);
if (Z_TYPE_P(manager) == IS_OBJECT) {
ZEPHIR_INIT_VAR(_0$$3);
ZEPHIR_INIT_VAR(_1$$3);
zephir_create_array(_1$$3, 2, 0 TSRMLS_CC);
zephir_array_fast_append(_1$$3, manager);
ZEPHIR_INIT_VAR(_2$$3);
ZVAL_STRING(_2$$3, "notifyCommit", 1);
zephir_array_fast_append(_1$$3, _2$$3);
ZEPHIR_INIT_VAR(_3$$3);
zephir_create_array(_3$$3, 1, 0 TSRMLS_CC);
zephir_array_fast_append(_3$$3, this_ptr);
ZEPHIR_CALL_USER_FUNC_ARRAY(_0$$3, _1$$3, _3$$3);
zephir_check_call_status();
}
_4 = zephir_fetch_nproperty_this(this_ptr, SL("_connection"), PH_NOISY_CC);
ZEPHIR_RETURN_CALL_METHOD(_4, "commit", NULL, 0);
zephir_check_call_status();
RETURN_MM();
}