/** * 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)); }
PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) { zval *n_param = NULL, *_0, _1 = zval_used_for_init, *_2; int n; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &n_param); n = zephir_get_intval(n_param); if ((n == 0)) { RETURN_MM_LONG(0); } else { if ((n == 1)) { RETURN_MM_LONG(1); } else { ZEPHIR_INIT_VAR(_0); ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, (n - 1)); zephir_call_internal_method_p1(_0, this_ptr, "fibonaccifinalrecursive", ZEND_MN(Test_Fibonnaci_fibonacciFinalRecursive), &_1); ZEPHIR_INIT_VAR(_2); ZEPHIR_SINIT_NVAR(_1); ZVAL_LONG(&_1, (n - 2)); zephir_call_internal_method_p1(_2, this_ptr, "fibonaccifinalrecursive", ZEND_MN(Test_Fibonnaci_fibonacciFinalRecursive), &_1); zephir_add_function(return_value, _0, _2 TSRMLS_CC); RETURN_MM(); } } ZEPHIR_MM_RESTORE(); }
PHP_METHOD(Test_Fibonnaci, fibonacciRecursive) { zephir_fcall_cache_entry *_2 = NULL; zval *n_param = NULL, *_0 = NULL, _1 = zval_used_for_init, *_3 = NULL; int n, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &n_param); n = zephir_get_intval(n_param); if (n == 0) { RETURN_MM_LONG(0); } else { if (n == 1) { RETURN_MM_LONG(1); } else { ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, (n - 1)); ZEPHIR_CALL_METHOD(&_0, this_ptr, "fibonaccirecursive", &_2, 33, &_1); zephir_check_call_status(); ZEPHIR_SINIT_NVAR(_1); ZVAL_LONG(&_1, (n - 2)); ZEPHIR_CALL_METHOD(&_3, this_ptr, "fibonaccirecursive", &_2, 33, &_1); zephir_check_call_status(); zephir_add_function_ex(return_value, _0, _3 TSRMLS_CC); RETURN_MM(); } } }
PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) { zephir_fcall_cache_entry *_2 = NULL; zval *n_param = NULL, *_0$$6 = NULL, *_1$$6 = NULL, *_3$$6 = NULL; int n, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &n_param); n = zephir_get_intval(n_param); if (n == 0) { RETURN_MM_LONG(0); } else { if (n == 1) { RETURN_MM_LONG(1); } else { ZEPHIR_INIT_VAR(_1$$6); ZVAL_LONG(_1$$6, (n - 1)); ZEPHIR_CALL_METHOD(&_0$$6, this_ptr, "fibonaccifinalrecursive", &_2, 36, _1$$6); zephir_check_call_status(); ZEPHIR_INIT_NVAR(_1$$6); ZVAL_LONG(_1$$6, (n - 2)); ZEPHIR_CALL_METHOD(&_3$$6, this_ptr, "fibonaccifinalrecursive", &_2, 36, _1$$6); zephir_check_call_status(); zephir_add_function(return_value, _0$$6, _3$$6); RETURN_MM(); } } }
/** * The kick command applies only to the currently used tube. */ PHP_METHOD(Phalcon_Queue_Beanstalk, kick) { zval *_1; zval *bound_param = NULL, *response = NULL, _0, *_2, *_3; int bound, ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &bound_param); bound = zephir_get_intval(bound_param); ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, bound); ZEPHIR_INIT_VAR(_1); ZEPHIR_CONCAT_SV(_1, "kick ", &_0); ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _1); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 409); zephir_check_call_status(); zephir_array_fetch_long(&_2, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 306 TSRMLS_CC); if (!ZEPHIR_IS_STRING(_2, "KICKED")) { RETURN_MM_BOOL(0); } ZEPHIR_OBS_VAR(_3); zephir_array_fetch_long(&_3, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 310 TSRMLS_CC); RETURN_MM_LONG(zephir_get_intval(_3)); }
PHP_METHOD(Test_Ternary, testTernaryComplex2) { int ZEPHIR_LAST_CALL_STATUS; zval *a, *y, *_0 = NULL, *_1 = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &a, &y); ZEPHIR_INIT_VAR(_0); if (100) { ZEPHIR_INIT_BNVAR(_0); ZVAL_LONG(_0, (1 + 100)); } else { ZEPHIR_CALL_METHOD(&_1, a, "y", NULL); zephir_check_call_status(); if (zephir_is_true(_1)) { ZEPHIR_CALL_METHOD(&_0, a, "x", NULL); zephir_check_call_status(); } else { ZEPHIR_INIT_BNVAR(_0); ZVAL_BOOL(_0, zephir_array_isset(a, y)); } } RETURN_MM_LONG((5 + zephir_get_numberval(_0))); }
PHP_METHOD(Test_McallInternal, d) { zval _3$$3; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS, a, i = 0, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); a = 0; _2 = 1000000; _1 = 0; _0 = 0; if (_1 <= _2) { while (1) { if (_0) { _1++; if (!(_1 <= _2)) { break; } } else { _0 = 1; } i = _1; ZEPHIR_CALL_INTERNAL_METHOD_P0(&_3$$3, this_ptr, zep_Test_McallInternal_a); zephir_check_call_status(); a += zephir_get_intval(&_3$$3); } } RETURN_MM_LONG(a); }
PHP_METHOD(Test_Flow, testFor1) { HashTable *_2; HashPosition _1; int c; zval *v = NULL, *b, *_0, **_3; ZEPHIR_MM_GROW(); c = 0; 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, 0); for ( ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS ; zend_hash_move_forward_ex(_2, &_1) ) { ZEPHIR_GET_HVALUE(v, _3); c += zephir_get_numberval(v); } RETURN_MM_LONG(c); }
PHP_METHOD(Test_Flow, testFor10) { zend_bool _0; int b, c, d, _1, _2; zval *a = NULL; ZEPHIR_MM_GROW(); b = 0; c = 1; d = 10; _2 = d; _1 = c; _0 = 0; if ((_1 <= _2)) { while (1) { if (_0) { _1++; if (!((_1 <= _2))) { break; } } else { _0 = 1; } ZEPHIR_INIT_NVAR(a); ZVAL_LONG(a, _1); b += zephir_get_numberval(a); } } RETURN_MM_LONG(b); }
PHP_METHOD(Test_McallInternal, f) { zval _3$$3; zend_bool _0; zephir_fcall_cache_entry *_4 = NULL; int ZEPHIR_LAST_CALL_STATUS, a, i = 0, _1, _2; ZEPHIR_INIT_THIS(); ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); a = 0; _2 = 1000000; _1 = 0; _0 = 0; if (_1 <= _2) { while (1) { if (_0) { _1++; if (!(_1 <= _2)) { break; } } else { _0 = 1; } i = _1; ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "e", &_4, 0); zephir_check_call_status(); a += zephir_get_intval(&_3$$3); } } RETURN_MM_LONG(a); }
PHP_METHOD(Test_BuiltIn_StringMethods, getLength5) { zval *a_param = NULL; zval a, _0; 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(&a); ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &a_param); zephir_get_strval(&a, a_param); ZEPHIR_INIT_VAR(&_0); ZEPHIR_CONCAT_SV(&_0, "hello", &a); RETURN_MM_LONG(zephir_fast_strlen_ev(&_0)); }
PHP_METHOD(Test_Flow, testFor38) { zend_bool _1; long _0; zval *v = NULL; int i = 0, _2, _3; ZEPHIR_MM_GROW(); _3 = 10; _2 = 1; _0 = 0; _1 = 0; if (_2 <= _3) { while (1) { if (_1) { _0++; _2++; if (!(_2 <= _3)) { break; } } else { _1 = 1; } _0 = _0; ZEPHIR_INIT_NVAR(v); ZVAL_LONG(v, _2); i++; } } RETURN_MM_LONG(i); }
PHP_METHOD(Test_Exceptions, issue1325) { zval e, status, _0; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_UNDEF(&e); ZVAL_UNDEF(&status); ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); /* try_start_1: */ ZEPHIR_CALL_METHOD(&status, this_ptr, "donoopexception", NULL, 27); zephir_check_call_status_or_jump(try_end_1); try_end_1: if (EG(exception)) { ZEPHIR_INIT_VAR(&_0); ZVAL_OBJ(&_0, EG(exception)); Z_ADDREF_P(&_0); if (zephir_instance_of_ev(&_0, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); ZEPHIR_CPY_WRT(&e, &_0); ZEPHIR_INIT_NVAR(&status); ZVAL_STRING(&status, "woop"); } } RETURN_MM_LONG(1); }
/** * Puts a job on the queue using specified tube. */ PHP_METHOD(Phalcon_Queue_Beanstalk, put) { zend_bool _1; int ZEPHIR_LAST_CALL_STATUS; zval *options = NULL; zval *data, *options_param = NULL, *priority = NULL, *delay = NULL, *ttr = NULL, *serialized = NULL, *response = NULL, *status = NULL, *length = NULL, *_0, *_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &data, &options_param); if (!options_param) { ZEPHIR_INIT_VAR(options); array_init(options); } else { zephir_get_arrval(options, options_param); } ZEPHIR_OBS_VAR(priority); if (!(zephir_array_isset_string_fetch(&priority, options, SS("priority"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(priority); ZVAL_LONG(priority, 100); } ZEPHIR_OBS_VAR(delay); if (!(zephir_array_isset_string_fetch(&delay, options, SS("delay"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(delay); ZVAL_LONG(delay, 0); } ZEPHIR_OBS_VAR(ttr); if (!(zephir_array_isset_string_fetch(&ttr, options, SS("ttr"), 0 TSRMLS_CC))) { ZEPHIR_INIT_NVAR(ttr); ZVAL_LONG(ttr, 86400); } ZEPHIR_CALL_FUNCTION(&serialized, "serialize", NULL, 65, data); zephir_check_call_status(); ZEPHIR_INIT_VAR(length); ZVAL_LONG(length, zephir_fast_strlen_ev(serialized)); ZEPHIR_INIT_VAR(_0); ZEPHIR_CONCAT_SVSVSVSVSV(_0, "put ", priority, " ", delay, " ", ttr, " ", length, "\r\n", serialized); ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 409); zephir_check_call_status(); zephir_array_fetch_long(&status, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 190 TSRMLS_CC); _1 = !ZEPHIR_IS_STRING(status, "INSERTED"); if (_1) { _1 = !ZEPHIR_IS_STRING(status, "BURIED"); } if (_1) { RETURN_MM_BOOL(0); } ZEPHIR_OBS_VAR(_2); zephir_array_fetch_long(&_2, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 196 TSRMLS_CC); RETURN_MM_LONG(zephir_get_intval(_2)); }
PHP_METHOD(PocketMine_Math_Vector2, getFloorX) { zval *_0; ZEPHIR_MM_GROW(); ZEPHIR_OBS_VAR(_0); zephir_read_property_this(&_0, this_ptr, SL("x"), PH_NOISY_CC); RETURN_MM_LONG(zephir_get_intval(_0)); }
PHP_METHOD(Test_BuiltIn_StringMethods, getLength3) { zval *_0; ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(_0); ZEPHIR_CONCAT_SS(_0, "hello", "hello"); RETURN_MM_LONG(zephir_fast_strlen_ev(_0)); }
void zep_Test_McallInternal_a(int ht, zval *return_value, zval *this_ptr, int return_value_used) { zval _0; ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hello"); RETURN_MM_LONG(zephir_fast_strlen_ev(&_0)); }
/** * Returns the status of the current session. * *<code> * var_dump($session->status()); * * if ($session->status() !== $session::SESSION_ACTIVE) { * $session->start(); * } *</code> */ PHP_METHOD(Phalcon_Session_Adapter, status) { zval *status = NULL; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); ZEPHIR_CALL_FUNCTION(&status, "session_status", NULL, 33); zephir_check_call_status(); do { if (ZEPHIR_IS_LONG(status, 0)) { RETURN_MM_LONG(0); } if (ZEPHIR_IS_LONG(status, 2)) { RETURN_MM_LONG(2); } } while(0); RETURN_MM_LONG(1); }
/** * Returns the count of properties set in the config * *<code> * print count($config); *</code> * * or * *<code> * print $config->count(); *</code> */ PHP_METHOD(Phalcon_Config, count) { int ZEPHIR_LAST_CALL_STATUS; zval *_0 = NULL; ZEPHIR_MM_GROW(); ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 23, this_ptr); zephir_check_call_status(); RETURN_MM_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); }
PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) { zephir_fcall_cache_entry *_2 = NULL; zval *n_param = NULL, _0$$6, _1$$6, _3$$6; int n, ZEPHIR_LAST_CALL_STATUS; 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(&_0$$6); ZVAL_UNDEF(&_1$$6); ZVAL_UNDEF(&_3$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &n_param); n = zephir_get_intval(n_param); if (n == 0) { RETURN_MM_LONG(0); } else { if (n == 1) { RETURN_MM_LONG(1); } else { ZVAL_LONG(&_1$$6, (n - 1)); ZEPHIR_CALL_METHOD(&_0$$6, this_ptr, "fibonaccifinalrecursive", &_2, 36, &_1$$6); zephir_check_call_status(); ZVAL_LONG(&_1$$6, (n - 2)); ZEPHIR_CALL_METHOD(&_3$$6, this_ptr, "fibonaccifinalrecursive", &_2, 36, &_1$$6); zephir_check_call_status(); zephir_add_function(return_value, &_0$$6, &_3$$6); RETURN_MM(); } } }
PHP_METHOD(Test_McallInternal, e) { zval _0; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "hello"); RETURN_MM_LONG(zephir_fast_strlen_ev(&_0)); }
PHP_METHOD(Test_BuiltIn_StringMethods, getLength4) { zval *a_param = NULL; zval *a = NULL; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &a_param); zephir_get_strval(a, a_param); RETURN_MM_LONG(zephir_fast_strlen_ev(a)); }
PHP_METHOD(Test_Arithmetic, doubleSumVarExpression) { zval _0, *_1 = NULL; double a = 0; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); a = 1.0; ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, 0); ZEPHIR_CALL_FUNCTION(&_1, "exp", NULL, 1, &_0); zephir_check_call_status(); RETURN_MM_LONG((a + zephir_get_numberval(_1))); }
PHP_METHOD(Test_SpectralNorm, Ax) { zval *i, *j, *_0, _1; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &i, &j); ZEPHIR_INIT_VAR(_0); zephir_add_function(_0, i, j TSRMLS_CC); ZEPHIR_SINIT_VAR(_1); zephir_add_function(&_1, i, j TSRMLS_CC); RETURN_MM_LONG((1 / ((((zephir_get_numberval(_0) * (zephir_get_numberval(&_1) + 1)) / 2) + zephir_get_numberval(i)) + 1))); }
/** * Return length of bag * *<code> * echo $user->count(); *</code> */ PHP_METHOD(Phalcon_Session_Bag, count) { zval *_0, *_1; int ZEPHIR_LAST_CALL_STATUS; ZEPHIR_MM_GROW(); _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } _1 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); RETURN_MM_LONG(zephir_fast_count_int(_1 TSRMLS_CC)); }
PHP_METHOD(Test_BuiltIn_StringMethods, getLength5) { zval *a_param = NULL; zval *a = NULL, *_0; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &a_param); zephir_get_strval(a, a_param); ZEPHIR_INIT_VAR(_0); ZEPHIR_CONCAT_SV(_0, "hello", a); RETURN_MM_LONG(zephir_fast_strlen_ev(_0)); }
PHP_METHOD(Test_BuiltIn_StringMethods, getLength3) { zval _0; 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(&_0); ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&_0); ZEPHIR_CONCAT_SS(&_0, "hello", "hello"); RETURN_MM_LONG(zephir_fast_strlen_ev(&_0)); }
/** * Return length of bag * *<code> * echo $user->count(); *</code> */ PHP_METHOD(Phalcon_Session_Bag, count) { zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } zephir_read_property(&_1, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); RETURN_MM_LONG(zephir_fast_count_int(&_1 TSRMLS_CC)); }
PHP_METHOD(Test_McallInternal, g) { zval _3$$3, _4$$3, _5$$3; zend_bool _0; long i = 0; int ZEPHIR_LAST_CALL_STATUS, a, _1, _2; ZEPHIR_INIT_THIS(); ZVAL_UNDEF(&_3$$3); ZVAL_UNDEF(&_4$$3); ZVAL_UNDEF(&_5$$3); ZEPHIR_MM_GROW(); a = 0; _2 = 1000; _1 = 0; _0 = 0; if (_1 <= _2) { while (1) { if (_0) { _1++; if (!(_1 <= _2)) { break; } } else { _0 = 1; } i = _1; ZVAL_LONG(&_4$$3, i); ZVAL_LONG(&_5$$3, i); ZEPHIR_CALL_INTERNAL_METHOD_P2(&_3$$3, this_ptr, zep_Test_McallInternal_c, &_4$$3, &_5$$3); zephir_check_call_status(); a += zephir_get_intval(&_3$$3); } } RETURN_MM_LONG(a); }
PHP_METHOD(Test_Flow, testFor32) { HashTable *_1; HashPosition _0; long sum = 0; zval *e, *v = NULL, **_2; ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &e); zephir_is_iterable(e, &_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(v, _2); sum += zephir_get_numberval(v); } RETURN_MM_LONG(sum); }