diff --git a/.github/actions/build-phalcon-win/action.yml b/.github/actions/build-phalcon-win/action.yml index af8b8ff5c9c..5ec1ed16fa8 100644 --- a/.github/actions/build-phalcon-win/action.yml +++ b/.github/actions/build-phalcon-win/action.yml @@ -74,7 +74,7 @@ runs: cache_dir: ${{ env.CACHE_DIR }} - name: Configure Developer Command Prompt for MSVC compiler - uses: ilammy/msvc-dev-cmd@v1.10.0 + uses: ilammy/msvc-dev-cmd@v1.12.1 with: arch: ${{ inputs.arch }} @@ -82,7 +82,7 @@ runs: # PHP Warning: PHP Startup: Can't load module 'C:\tools\php\ext\php_zephir_parser.dll' # as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0 - name: Configure Developer Command Prompt for MSVC compiler - uses: ilammy/msvc-dev-cmd@v1.10.0 + uses: ilammy/msvc-dev-cmd@v1.12.1 if: ${{ inputs.php_version }} == '7.4' with: arch: ${{ inputs.arch }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01b074dfae3..b4b73cfacf7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ on: env: # All versions should be declared here - PHALCON_VERSION: 5.5.0 + PHALCON_VERSION: 5.6.0 ZEPHIR_PARSER_VERSION: 1.6.0 # For tests @@ -284,7 +284,7 @@ jobs: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Download Phalcon Pecl Package - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: phalcon-pecl path: ./phalcon-pecl @@ -386,12 +386,13 @@ jobs: - name: Get the release version id: get-version run: | - echo ::set-output name=version::${GITHUB_REF#refs/tags/} + echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV +# echo ::set-output name=version::${GITHUB_REF#refs/tags/} # echo "version=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV" # This needs to be checked - name: Download Phalcon build artifacts id: download - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: path: ./build-artifacts @@ -407,8 +408,8 @@ jobs: uses: ncipollo/release-action@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - name: ${{ steps.get-version.outputs.version }} - tag: ${{ steps.get-version.outputs.version }} + name: ${{ env.version }} + tag: ${{ env.version }} bodyFile: "./build-artifacts/release/release-notes.md" allowUpdates: true artifacts: "./build-artifacts/release/*.zip,./build-artifacts/release/*.tgz" diff --git a/CHANGELOG-5.0.md b/CHANGELOG-5.0.md index e5366d16315..258940bc9db 100644 --- a/CHANGELOG-5.0.md +++ b/CHANGELOG-5.0.md @@ -1,5 +1,24 @@ # Changelog +## [5.6.0](https://github.com/phalcon/cphalcon/releases/tag/v5.6.0) (2024-01-09) + +### Changed + +- Changed `Phalcon\Db\Adapter\Pdo\Mysql` to not use specific flags for `PDO` (`PDO::ATTR_EMULATE_PREPARES` or `PDO::ATTR_STRINGIFY_FETCHES`) for performance reasons [#16474](https://github.com/phalcon/cphalcon/issues/16474) +- Merged `Phalcon\Db\AbstractDb` with `Phalcon\Db\Adapter\AbstractAdapter` since the former was not used [#16474](https://github.com/phalcon/cphalcon/issues/16474) + +### Added + +- Added `resetColumns()`, `resetFrom()`, `resetWhere()`, `resetGroupBy()`, `resetHaving()`, `resetOrderBy()`, `resetLimit()`, `resetFlags()` to the `Phalcon\Datamapper\Query\AbstractQuery` to allow resetting query filters. + +### Fixed + +- Fixed `Phalcon\Mvc\Model::count` to ignore the `order` parameter (needed for Posgresql) [#16471](https://github.com/phalcon/cphalcon/issues/16471) +- Fixed `Phalcon\Mvc\Model::toArray` added parameter to ignore getters in order not to break serialize. [#16490](https://github.com/phalcon/cphalcon/issues/16490) +- Fixed `Phalcon\Mvc\Model::toArray` changing the conditionals for population to remove segfault. [#16498](https://github.com/phalcon/cphalcon/issues/16498) + +### Removed + ## [5.5.0](https://github.com/phalcon/cphalcon/releases/tag/v5.5.0) (2023-12-25) ### Changed diff --git a/README.md b/README.md index b76188f0418..75ca68ea4c1 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Steps: - Checkout the tag you would like to generate docs for. - Run `php tests/__config/generate-api-docs.php` - The files *.md files in nikos/api/ will contain the documentation -- For publishing to the Phalcon website this [repo](https://github.com/phalcon/docs/tree/5.0/en/api) is used. +- For publishing to the Phalcon website this [repo](https://github.com/phalcon/docs/tree/5.0/api) is used. ## Links diff --git a/build/phalcon/phalcon.zep.c b/build/phalcon/phalcon.zep.c index a0f5a30cb9a..919baaac5f0 100644 --- a/build/phalcon/phalcon.zep.c +++ b/build/phalcon/phalcon.zep.c @@ -1919,11 +1919,6 @@ zend_string* i_self; #define PH_COPY 1024 #define PH_CTOR 4096 -/* Deprecated */ -#ifndef zend_uint - #define zend_uint uint32_t -#endif - #ifndef ZEND_ACC_FINAL_CLASS #define ZEND_ACC_FINAL_CLASS ZEND_ACC_FINAL #endif @@ -2073,7 +2068,6 @@ zend_string* i_self; #define RETURN_MM_ON_FAILURE(what) \ do { \ if (what == FAILURE) { \ - ZEPHIR_MM_RESTORE(); \ return; \ } \ } while (0) @@ -2164,7 +2158,7 @@ static int zephir_fetch_parameters(int num_args, int required_args, int optional zval _null; \ ZVAL_NULL(&_null); \ ZVAL_COPY(return_value, &_null); \ - zephir_ptr_dtor(&_null); \ + zval_ptr_dtor(&_null); \ } else { \ ZVAL_COPY(return_value, _constant_ptr); \ } \ @@ -2206,12 +2200,6 @@ static void zephir_module_init(); #define ZEPHIR_KERNEL_MEMORY_H -#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64) - #define ZEPHIR_ENABLE_64BITS 1 -#endif - -#define ZEPHIR_NUM_PREALLOCATED_FRAMES 25 - /** Memory frame */ typedef struct _zephir_memory_entry { size_t pointer; @@ -2242,21 +2230,14 @@ typedef struct _zephir_method_globals { static void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const char *func); static void ZEPHIR_FASTCALL zephir_memory_restore_stack(zephir_method_globals *g, const char *func); -#define ZEPHIR_MM_GROW() \ - ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); \ - zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - #define ZEPHIR_MM_RESTORE() \ zephir_memory_restore_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); \ pefree(ZEPHIR_METHOD_GLOBALS_PTR, 0); \ ZEPHIR_METHOD_GLOBALS_PTR = NULL; static void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr); -static int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key); static void zephir_deinitialize_memory(); -#define zephir_ptr_dtor(x) zval_ptr_dtor(x) - static void ZEPHIR_FASTCALL zephir_do_memory_observe(zval *var, const zephir_method_globals *g); #define zephir_memory_observe(var) zephir_do_memory_observe(var, ZEPHIR_METHOD_GLOBALS_PTR); @@ -2267,14 +2248,11 @@ static void zephir_create_symbol_table(zephir_method_globals *g); #define ZEPHIR_CREATE_SYMBOL_TABLE() zephir_create_symbol_table(ZEPHIR_METHOD_GLOBALS_PTR); static int zephir_set_symbol(zval *key_name, zval *value); -static int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value); #define ZEPHIR_INIT_VAR(z) \ zephir_memory_observe(z); \ ZVAL_NULL(z); -#define ZEPHIR_INIT_ZVAL_NREF(z) ZVAL_UNDEF(&z); - #define ZEPHIR_INIT_NVAR(z) \ do { \ if (Z_TYPE_P(z) == IS_UNDEF) { \ @@ -2289,14 +2267,11 @@ static int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval * ZVAL_NULL(z); \ } while (0) -/* only removes the value body of the zval */ -#define ZEPHIR_INIT_LNVAR(z) ZEPHIR_INIT_NVAR(&z) - #define ZEPHIR_CPY_WRT(d, v) \ Z_TRY_ADDREF_P(v); \ if (Z_TYPE_P(d) > IS_UNDEF) { \ if (Z_REFCOUNTED_P(d) && Z_REFCOUNT_P(d) > 0) { \ - zephir_ptr_dtor(d); \ + zval_ptr_dtor(d); \ } \ } else { \ zephir_memory_observe(d); \ @@ -2306,24 +2281,16 @@ static int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval * #define ZEPHIR_CPY_WRT_CTOR(d, v) \ if (d) { \ if (Z_REFCOUNTED_P(d) && Z_REFCOUNT_P(d) > 0) { \ - zephir_ptr_dtor(d); \ + zval_ptr_dtor(d); \ } \ - } else { \ - /*TODO: as above */ \ } \ ZVAL_DUP(d, v); -#define ZEPHIR_OBS_VAR(z) \ - zephir_memory_observe(z) - -#define ZEPHIR_OBS_VAR_ONCE(z) \ +#define ZEPHIR_OBS_COPY_OR_DUP(z, v) \ if (Z_TYPE_P(z) == IS_UNDEF) { \ zephir_memory_observe(z); \ - } - -#define ZEPHIR_OBS_COPY_OR_DUP(z, v) \ - ZEPHIR_OBS_VAR_ONCE(z); \ - ZVAL_COPY(z, v); + } \ + ZVAL_COPY(z, v); #define ZEPHIR_HASH_COPY(z, v) \ if (Z_TYPE_P(z) == IS_ARRAY && Z_TYPE_P(v) == IS_ARRAY) { \ @@ -2335,7 +2302,7 @@ static int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval * if (Z_REFCOUNTED_P(z) && Z_REFCOUNT_P(z) > 1) { \ Z_DELREF_P(z); \ } else {\ - zephir_ptr_dtor(z); \ + zval_ptr_dtor(z); \ ZVAL_NULL(z); \ } \ } else { \ @@ -2350,7 +2317,7 @@ static int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval * zval *tmp_ = (ppzv); \ if (tmp_ != NULL) { \ if (Z_TYPE_P(tmp_) != IS_UNDEF) { \ - zephir_ptr_dtor(tmp_); \ + zval_ptr_dtor(tmp_); \ } else { \ zephir_memory_observe(tmp_); \ } \ @@ -2358,13 +2325,10 @@ static int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval * } \ } while (0) -#define ZEPHIR_SEPARATE(z) SEPARATE_ZVAL(z) - #define ZEPHIR_SEPARATE_PARAM(z) \ do { \ zval *orig_ptr = z; \ - ZEPHIR_SEPARATE(orig_ptr); \ - /*zephir_memory_observe(orig_ptr);*/ \ + SEPARATE_ZVAL(orig_ptr); \ } while (0) #endif @@ -2566,8 +2530,6 @@ static int zephir_method_exists_ex(zval *object, const char *method_name, unsign -#ifndef ZEPHIR_KERNEL_ARRAY_H -#define ZEPHIR_KERNEL_ARRAY_H #define ZEPHIR_MAX_ARRAY_LEVELS 16 @@ -2623,8 +2585,6 @@ static int zephir_fast_in_array(zval *needle, zval *haystack); zend_hash_next_index_insert(Z_ARRVAL_P(arr), value); \ } while (0) -#endif /* ZEPHIR_KERNEL_ARRAY_H */ - #ifndef ZEPHIR_KERNEL_STRING_H @@ -2845,19 +2805,11 @@ typedef enum _zephir_call_type { ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#if PHP_VERSION_ID >= 80000 #define ZEPHIR_RETURN_CALL_STATIC(method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, (getThis() ? Z_OBJCE_P(getThis()) : NULL), zephir_fcall_static, getThis(), method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#else -#define ZEPHIR_RETURN_CALL_STATIC(method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ - } while (0) -#endif #define ZEPHIR_RETURN_CALL_PARENT(class_entry, this_ptr, method, cache, cache_slot, ...) \ do { \ @@ -2865,51 +2817,25 @@ typedef enum _zephir_call_type { ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#if PHP_VERSION_ID >= 80000 #define ZEPHIR_CALL_SELF(return_value_ptr, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, (getThis() ? Z_OBJCE_P(getThis()) : NULL), zephir_fcall_self, getThis(), method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#else -#define ZEPHIR_CALL_SELF(return_value_ptr, method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ - } while (0) -#endif -#if PHP_VERSION_ID >= 80000 #define ZEPHIR_RETURN_CALL_SELF(method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, (getThis() ? Z_OBJCE_P(getThis()) : NULL), zephir_fcall_self, getThis(), method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#else -#define ZEPHIR_RETURN_CALL_SELF(method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ - } while (0) -#endif -#if PHP_VERSION_ID >= 80000 #define ZEPHIR_CALL_STATIC(return_value_ptr, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, (getThis() ? Z_OBJCE_P(getThis()) : NULL), zephir_fcall_static, getThis(), method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#else -#define ZEPHIR_CALL_STATIC(return_value_ptr, method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ - } while (0) -#endif #define ZEPHIR_CALL_CE_STATIC(return_value_ptr, class_entry, method, cache, cache_slot, ...) \ do { \ @@ -3345,7 +3271,11 @@ long zephir_safe_mod_double_zval(double op1, zval *op2); #define zephir_get_boolval(z) (Z_TYPE_P(z) == IS_TRUE ? 1 : (Z_TYPE_P(z) == IS_FALSE ? 0 : zephir_get_boolval_ex(z))) #define zephir_get_charval(z) (Z_TYPE_P(z) == IS_LONG ? Z_LVAL_P(z) : zephir_get_charval_ex(z)) +#if PHP_VERSION_ID >= 80300 +#define zephir_add_function(result, left, right) add_function(result, left, right) +#else #define zephir_add_function(result, left, right) fast_add_function(result, left, right) +#endif #define zephir_sub_function(result, left, right) sub_function(result, left, right) #define zephir_pow_function(result, op1, op2) pow_function(result, op1, op2) #define zephir_increment(var) increment_function(var) @@ -3354,7 +3284,7 @@ long zephir_safe_mod_double_zval(double op1, zval *op2); #define ZEPHIR_ADD_ASSIGN(z, v) \ { \ zval tmp; \ - ZEPHIR_SEPARATE(z); \ + SEPARATE_ZVAL(z); \ add_function(&tmp, z, v); \ if (Z_TYPE(tmp) == IS_LONG) { \ Z_LVAL_P(z) = Z_LVAL(tmp); \ @@ -3368,7 +3298,7 @@ long zephir_safe_mod_double_zval(double op1, zval *op2); #define ZEPHIR_SUB_ASSIGN(z, v) \ { \ zval tmp; \ - ZEPHIR_SEPARATE(z); \ + SEPARATE_ZVAL(z); \ sub_function(&tmp, z, v); \ if (Z_TYPE(tmp) == IS_LONG) { \ Z_LVAL_P(z) = Z_LVAL(tmp); \ @@ -3382,7 +3312,7 @@ long zephir_safe_mod_double_zval(double op1, zval *op2); #define ZEPHIR_MUL_ASSIGN(z, v) \ { \ zval tmp; \ - ZEPHIR_SEPARATE(z); \ + SEPARATE_ZVAL(z); \ mul_function(&tmp, z, v); \ if (Z_TYPE(tmp) == IS_LONG) { \ Z_LVAL_P(z) = Z_LVAL(tmp); \ @@ -3932,26 +3862,17 @@ static void zephir_fast_count(zval *result, zval *value) } if (Z_TYPE_P(value) == IS_OBJECT) { - zval retval; if (Z_OBJ_HT_P(value)->count_elements) { ZVAL_LONG(result, 1); -#if PHP_VERSION_ID >= 80000 if (SUCCESS == Z_OBJ_HT(*value)->count_elements(Z_OBJ_P(value), &Z_LVAL_P(result))) { -#else - if (SUCCESS == Z_OBJ_HT(*value)->count_elements(value, &Z_LVAL_P(result))) { -#endif return; } } if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { -#if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); -#else - zend_call_method_with_0_params(value, NULL, NULL, "count", &retval); -#endif if (Z_TYPE(retval) != IS_UNDEF) { convert_to_long_ex(&retval); ZVAL_LONG(result, Z_LVAL(retval)); @@ -3981,24 +3902,15 @@ static int zephir_fast_count_ev(zval *value) } if (Z_TYPE_P(value) == IS_OBJECT) { - zval retval; if (Z_OBJ_HT_P(value)->count_elements) { -#if PHP_VERSION_ID >= 80000 Z_OBJ_HT(*value)->count_elements(Z_OBJ_P(value), &count); -#else - Z_OBJ_HT(*value)->count_elements(value, &count); -#endif return (int) count > 0; } if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { -#if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); -#else - zend_call_method_with_0_params(value, NULL, NULL, "count", &retval); -#endif if (Z_TYPE(retval) != IS_UNDEF) { convert_to_long_ex(&retval); count = Z_LVAL(retval); @@ -4030,20 +3942,12 @@ static int zephir_fast_count_int(zval *value) zval retval; if (Z_OBJ_HT_P(value)->count_elements) { -#if PHP_VERSION_ID >= 80000 Z_OBJ_HT(*value)->count_elements(Z_OBJ_P(value), &count); -#else - Z_OBJ_HT(*value)->count_elements(value, &count); -#endif return (int) count; } if (instanceof_function(Z_OBJCE_P(value), zend_ce_countable)) { -#if PHP_VERSION_ID >= 80000 zend_call_method_with_0_params(Z_OBJ_P(value), NULL, NULL, "count", &retval); -#else - zend_call_method_with_0_params(value, NULL, NULL, "count", &retval); -#endif if (Z_TYPE(retval) != IS_UNDEF) { convert_to_long_ex(&retval); count = Z_LVAL(retval); @@ -4065,7 +3969,7 @@ static int zephir_fast_count_int(zval *value) static int zephir_function_exists(const zval *function_name) { - if (zend_hash_str_exists(CG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name)) != NULL) { + if (zend_hash_str_exists(CG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name))) { return SUCCESS; } @@ -4173,7 +4077,6 @@ zend_class_entry* zephir_get_internal_ce(const char *class_name, unsigned int cl /* Declare constants */ static int zephir_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value) { -#if PHP_VERSION_ID >= 80000 zend_string *key; if (ce->type == ZEND_INTERNAL_CLASS) { @@ -4189,24 +4092,6 @@ static int zephir_declare_class_constant(zend_class_entry *ce, const char *name, } return SUCCESS; -#else - int ret; - zend_string *key; - - if (ce->type == ZEND_INTERNAL_CLASS) { - key = zend_string_init_interned(name, name_length, 1); - } else { - key = zend_string_init(name, name_length, 0); - } - - ret = zend_declare_class_constant_ex(ce, key, value, ZEND_ACC_PUBLIC, NULL); - - if (ce->type != ZEND_INTERNAL_CLASS) { - zend_string_release(key); - } - - return ret; -#endif } static int zephir_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length) @@ -4377,144 +4262,144 @@ static void zephir_module_init() static zend_always_inline zend_execute_data* find_symbol_table(zend_execute_data* ex) { - while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->common.type))) { - ex = ex->prev_execute_data; - } + while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->common.type))) { + ex = ex->prev_execute_data; + } - return ex; + return ex; } static void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const char *func) { - if (g->active_memory == NULL) { - zephir_memory_entry *active_memory; +if (g->active_memory == NULL) { + zephir_memory_entry *active_memory; - active_memory = (zephir_memory_entry *) pecalloc(1, sizeof(zephir_memory_entry), 0); + active_memory = (zephir_memory_entry *) pecalloc(1, sizeof(zephir_memory_entry), 0); - active_memory->addresses = pecalloc(24, sizeof(zval*), 0); - active_memory->capacity = 24; + active_memory->addresses = pecalloc(24, sizeof(zval*), 0); + active_memory->capacity = 24; - g->active_memory = active_memory; - } + g->active_memory = active_memory; +} - assert(g->active_memory != NULL); - assert(g->active_memory->pointer == 0); +assert(g->active_memory != NULL); +assert(g->active_memory->pointer == 0); #ifndef ZEPHIR_RELEASE - g->active_memory->func = func; +g->active_memory->func = func; #endif } static void ZEPHIR_FASTCALL zephir_memory_restore_stack(zephir_method_globals *g, const char *func) { - size_t i; - zephir_memory_entry *active_memory; - zephir_symbol_table *active_symbol_table; - zval *ptr; +size_t i; +zephir_memory_entry *active_memory; +zephir_symbol_table *active_symbol_table; +zval *ptr; #ifndef ZEPHIR_RELEASE - int show_backtrace = 0; +int show_backtrace = 0; #endif #ifndef ZEPHIR_RELEASE - if (UNEXPECTED(g->active_memory == NULL)) { - fprintf(stderr, "WARNING: calling zephir_memory_restore_stack() without an active memory frame!\n"); - fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); - fprintf(stderr, "Calling function: %s\n", func); - zephir_print_backtrace(); - return; - } +if (UNEXPECTED(g->active_memory == NULL)) { + fprintf(stderr, "WARNING: calling zephir_memory_restore_stack() without an active memory frame!\n"); + fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); + fprintf(stderr, "Calling function: %s\n", func); + zephir_print_backtrace(); + return; +} - if (UNEXPECTED(g->active_memory->func != func)) { - fprintf(stderr, "Trying to free someone else's memory frame!\n"); - fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); - fprintf(stderr, "Calling function: %s\n", func); - zephir_print_backtrace(); - return; - } +if (UNEXPECTED(g->active_memory->func != func)) { + fprintf(stderr, "Trying to free someone else's memory frame!\n"); + fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); + fprintf(stderr, "Calling function: %s\n", func); + zephir_print_backtrace(); + return; +} #endif - active_memory = g->active_memory; - assert(active_memory != NULL); +active_memory = g->active_memory; +assert(active_memory != NULL); - if (EXPECTED(!CG(unclean_shutdown))) { - /* Clean active symbol table */ - if (g->active_symbol_table) { - active_symbol_table = g->active_symbol_table; - while (active_symbol_table && active_symbol_table->scope == active_memory) { - zend_execute_data *ex = find_symbol_table(EG(current_execute_data)); +if (EXPECTED(!CG(unclean_shutdown))) { + /* Clean active symbol table */ + if (g->active_symbol_table) { + active_symbol_table = g->active_symbol_table; + while (active_symbol_table && active_symbol_table->scope == active_memory) { + zend_execute_data *ex = find_symbol_table(EG(current_execute_data)); #ifndef ZEPHIR_RELEASE - if (UNEXPECTED(!ex)) { - fprintf(stderr, "ERROR: unable to find a symbol table"); - zephir_print_backtrace(); - return; - } + if (UNEXPECTED(!ex)) { + fprintf(stderr, "ERROR: unable to find a symbol table"); + zephir_print_backtrace(); + return; + } #endif - zend_hash_destroy(ex->symbol_table); - efree(ex->symbol_table); - ex->symbol_table = active_symbol_table->symbol_table; - zend_attach_symbol_table(ex); - zend_rebuild_symbol_table(); + zend_hash_destroy(ex->symbol_table); + efree(ex->symbol_table); + ex->symbol_table = active_symbol_table->symbol_table; + zend_attach_symbol_table(ex); + zend_rebuild_symbol_table(); - g->active_symbol_table = active_symbol_table->prev; - efree(active_symbol_table); - active_symbol_table = g->active_symbol_table; - } + g->active_symbol_table = active_symbol_table->prev; + efree(active_symbol_table); + active_symbol_table = g->active_symbol_table; } + } #ifndef ZEPHIR_RELEASE - for (i = 0; i < active_memory->pointer; ++i) { - if (active_memory->addresses[i] != NULL) { - zval *var = active_memory->addresses[i]; - if (Z_TYPE_P(var) > IS_CALLABLE) { - fprintf(stderr, "%s: observed variable #%d (%p) has invalid type %u [%s]\n", __func__, (int)i, var, Z_TYPE_P(var), active_memory->func); - show_backtrace = 1; - } + for (i = 0; i < active_memory->pointer; ++i) { + if (active_memory->addresses[i] != NULL) { + zval *var = active_memory->addresses[i]; + if (Z_TYPE_P(var) > IS_CALLABLE) { + fprintf(stderr, "%s: observed variable #%d (%p) has invalid type %u [%s]\n", __func__, (int)i, var, Z_TYPE_P(var), active_memory->func); + show_backtrace = 1; + } - if (!Z_REFCOUNTED_P(var)) { - continue; - } + if (!Z_REFCOUNTED_P(var)) { + continue; + } - if (Z_REFCOUNT_P(var) == 0) { - fprintf(stderr, "%s: observed variable #%d (%p) has 0 references, type=%d [%s]\n", __func__, (int)i, var, Z_TYPE_P(var), active_memory->func); - show_backtrace = 1; - } - else if (Z_REFCOUNT_P(var) >= 1000000) { - fprintf(stderr, "%s: observed variable #%d (%p) has too many references (%u), type=%d [%s]\n", __func__, (int)i, var, Z_REFCOUNT_P(var), Z_TYPE_P(var), active_memory->func); - show_backtrace = 1; - } + if (Z_REFCOUNT_P(var) == 0) { + fprintf(stderr, "%s: observed variable #%d (%p) has 0 references, type=%d [%s]\n", __func__, (int)i, var, Z_TYPE_P(var), active_memory->func); + show_backtrace = 1; + } + else if (Z_REFCOUNT_P(var) >= 1000000) { + fprintf(stderr, "%s: observed variable #%d (%p) has too many references (%u), type=%d [%s]\n", __func__, (int)i, var, Z_REFCOUNT_P(var), Z_TYPE_P(var), active_memory->func); + show_backtrace = 1; } } + } #endif - /* Traverse all zvals allocated, reduce the reference counting or free them */ - for (i = 0; i < active_memory->pointer; ++i) { - ptr = active_memory->addresses[i]; - if (EXPECTED(ptr != NULL)) { - if (!Z_REFCOUNTED_P(ptr)) continue; - if (Z_REFCOUNT_P(ptr) == 1) { - zval_ptr_dtor(ptr); - } else { - Z_DELREF_P(ptr); - } + /* Traverse all zvals allocated, reduce the reference counting or free them */ + for (i = 0; i < active_memory->pointer; ++i) { + ptr = active_memory->addresses[i]; + if (EXPECTED(ptr != NULL)) { + if (!Z_REFCOUNTED_P(ptr)) continue; + if (Z_REFCOUNT_P(ptr) == 1) { + zval_ptr_dtor(ptr); + } else { + Z_DELREF_P(ptr); } } } +} #ifndef ZEPHIR_RELEASE - active_memory->func = NULL; +active_memory->func = NULL; #endif - if (active_memory->addresses != NULL) { - pefree(active_memory->addresses, 0); - } +if (active_memory->addresses != NULL) { + pefree(active_memory->addresses, 0); +} - pefree(g->active_memory, 0); - g->active_memory = NULL; +pefree(g->active_memory, 0); +g->active_memory = NULL; #ifndef ZEPHIR_RELEASE - if (show_backtrace == 1) { - zephir_print_backtrace(); - } +if (show_backtrace == 1) { + zephir_print_backtrace(); +} #endif } @@ -4598,44 +4483,6 @@ static int zephir_set_symbol(zval *key_name, zval *value) return SUCCESS; } -static int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value) -{ - zend_array *symbol_table = zend_rebuild_symbol_table(); - - if (!symbol_table) { - php_error_docref(NULL, E_WARNING, "Cannot find a valid symbol_table"); - return FAILURE; - } - - Z_TRY_ADDREF_P(value); - zend_hash_str_update(symbol_table, key_name, key_length, value); - - return SUCCESS; -} - -static int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) -{ - zephir_fcall_cache_entry **entry = (zephir_fcall_cache_entry**) pDest; - zend_class_entry *scope; - size_t len = ZSTR_LEN(hash_key->key); - - assert(hash_key->key != NULL); - assert(len > 2 * sizeof(zend_class_entry**)); - - memcpy(&scope, &ZSTR_VAL(hash_key->key)[(len -1) - 2 * sizeof(zend_class_entry**)], sizeof(zend_class_entry*)); - - - if ((*entry)->type != ZEND_INTERNAL_FUNCTION || (scope && scope->type != ZEND_INTERNAL_CLASS)) { - return ZEND_HASH_APPLY_REMOVE; - } - - if (scope && scope->type == ZEND_INTERNAL_CLASS && scope->info.internal.module->type != MODULE_PERSISTENT) { - return ZEND_HASH_APPLY_REMOVE; - } - - return ZEND_HASH_APPLY_KEEP; -} - static void ZEPHIR_FASTCALL zephir_do_memory_observe(zval *var, const zephir_method_globals *g) { zephir_memory_entry *frame = g->active_memory; @@ -4693,7 +4540,8 @@ static void zephir_throw_exception_debug(zval *object, const char *file, uint32_ ZVAL_UNDEF(&curline); - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); if (Z_TYPE_P(object) != IS_OBJECT) { ZVAL_COPY_VALUE(&object_copy, object); @@ -4709,14 +4557,8 @@ static void zephir_throw_exception_debug(zval *object, const char *file, uint32_ zephir_check_call_status(); if (ZEPHIR_IS_LONG(&curline, 0)) { default_exception_ce = zend_exception_get_default(); - -#if PHP_VERSION_ID >= 80000 zend_update_property_string(default_exception_ce, Z_OBJ_P(object), SL("file"), file); zend_update_property_long(default_exception_ce, Z_OBJ_P(object), SL("line"), line); -#else - zend_update_property_string(default_exception_ce, object, SL("file"), file); - zend_update_property_long(default_exception_ce, object, SL("line"), line); -#endif } } @@ -4740,13 +4582,8 @@ static void zephir_throw_exception_string_debug(zend_class_entry *ce, const char if (line > 0) { default_exception_ce = zend_exception_get_default(); -#if PHP_VERSION_ID >= 80000 zend_update_property_string(default_exception_ce, Z_OBJ(object), "file", sizeof("file")-1, file); zend_update_property_long(default_exception_ce, Z_OBJ(object), "line", sizeof("line")-1, line); -#else - zend_update_property_string(default_exception_ce, &object, "file", sizeof("file")-1, file); - zend_update_property_long(default_exception_ce, &object, "line", sizeof("line")-1, line); -#endif } if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { @@ -5159,11 +4996,7 @@ static int zephir_clone(zval *destination, zval *obj) status = FAILURE; } else { if (!EG(exception)) { -#if PHP_VERSION_ID >= 80000 ZVAL_OBJ(destination, clone_call(Z_OBJ_P(obj))); -#else - ZVAL_OBJ(destination, clone_call(obj)); -#endif if (EG(exception)) { zval_ptr_dtor(destination); } @@ -5181,19 +5014,11 @@ static int zephir_isset_property(zval *object, const char *property_name, unsign return 1; } -#if PHP_VERSION_ID >= 80000 return zend_hash_str_exists( Z_OBJ_HT_P(object)->get_properties(Z_OBJ_P(object)), property_name, property_length ); -#else - return zend_hash_str_exists( - Z_OBJ_HT_P(object)->get_properties(object), - property_name, - property_length - ); -#endif } return 0; @@ -5206,19 +5031,11 @@ static int zephir_isset_property_zval(zval *object, const zval *property) if (EXPECTED(zend_hash_str_exists(&Z_OBJCE_P(object)->properties_info, Z_STRVAL_P(property), Z_STRLEN_P(property)))) { return 1; } else { -#if PHP_VERSION_ID >= 80000 return zend_hash_str_exists( Z_OBJ_HT_P(object)->get_properties(Z_OBJ_P(object)), Z_STRVAL_P(property), Z_STRLEN_P(property) ); -#else - return zend_hash_str_exists( - Z_OBJ_HT_P(object)->get_properties(object), - Z_STRVAL_P(property), - Z_STRLEN_P(property) - ); -#endif } } } @@ -5326,15 +5143,9 @@ static int zephir_read_property( } ZVAL_STRINGL(&property, property_name, property_length); -#if PHP_VERSION_ID >= 80000 res = Z_OBJ_HT_P(object)->read_property(Z_OBJ_P(object), Z_STR(property), flags ? BP_VAR_IS : BP_VAR_R, NULL, &tmp); -#else - res = Z_OBJ_HT_P(object)->read_property(object, &property, - flags ? BP_VAR_IS : BP_VAR_R, - NULL, &tmp); -#endif if ((flags & PH_READONLY) == PH_READONLY) { ZVAL_COPY_VALUE(result, res); @@ -5459,11 +5270,7 @@ static int zephir_update_property_zval( /* write_property will add 1 to refcount, so no Z_TRY_ADDREF_P(value) is necessary */ -#if PHP_VERSION_ID >= 80000 Z_OBJ_HT_P(object)->write_property(Z_OBJ_P(object), Z_STR(property), &sep_value, 0); -#else - Z_OBJ_HT_P(object)->write_property(object, &property, &sep_value, 0); -#endif zval_ptr_dtor(&property); @@ -5549,7 +5356,7 @@ static int zephir_update_property_array(zval *object, const char *property, uint if (separated) { zephir_update_property_zval(object, property, property_length, &tmp); - zephir_ptr_dtor(&tmp); + zval_ptr_dtor(&tmp); } return SUCCESS; @@ -5623,7 +5430,7 @@ static int zephir_update_property_array_append(zval *object, char *property, uns if (separated) { zephir_update_property_zval(object, property, property_length, &tmp); - zephir_ptr_dtor(&tmp); + zval_ptr_dtor(&tmp); } return SUCCESS; @@ -5682,7 +5489,7 @@ static int zephir_update_property_array_multi(zval *object, const char *property if (separated) { zephir_update_property_zval(object, property, property_length, &tmp_arr); - zephir_ptr_dtor(&tmp_arr); + zval_ptr_dtor(&tmp_arr); } } @@ -5705,11 +5512,7 @@ static int zephir_unset_property(zval* object, const char* name) /* Use caller's scope */ zephir_set_scope(Z_OBJCE_P(object)); -#if PHP_VERSION_ID >= 80000 Z_OBJ_HT_P(object)->unset_property(Z_OBJ_P(object), Z_STR(member), 0); -#else - Z_OBJ_HT_P(object)->unset_property(object, &member, 0); -#endif /* Restore original scope */ zephir_set_scope(scope); @@ -6038,11 +5841,7 @@ static int zephir_create_instance(zval *return_value, const zval *class_name) fci.retval = 0; fci.param_count = 0; fci.params = 0; -#if PHP_VERSION_ID < 80000 - fci.no_separation = 1; -#else - fci.named_params = NULL; -#endif + fci.named_params = NULL; ZVAL_NULL(&fci.function_name); @@ -6097,11 +5896,8 @@ static int zephir_create_instance_params(zval *return_value, const zval *class_n fci.retval = 0; fci.param_count = 0; fci.params = 0; -#if PHP_VERSION_ID < 80000 - fci.no_separation = 1; -#else - fci.named_params = NULL; -#endif + fci.named_params = NULL; + ZVAL_NULL(&fci.function_name); fcc.object = obj; @@ -7513,11 +7309,8 @@ static void zephir_fast_join(zval *result, zval *glue, zval *pieces) zend_error(E_WARNING, "Invalid arguments supplied for join()"); return; } -#if PHP_VERSION_ID < 80000 - php_implode(Z_STR_P(glue), pieces, result); -#else + php_implode(Z_STR_P(glue), Z_ARRVAL_P(pieces), result); -#endif } static void zephir_fast_join_str(zval *return_value, char *glue, unsigned int glue_length, zval *pieces) @@ -8590,21 +8383,12 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze } fcic->called_scope = called_scope; - -#if PHP_VERSION_ID >= 80000 calling_scope = zend_get_called_scope(EG(current_execute_data)); -#else - calling_scope = zend_get_executed_scope(); -#endif - fcic->object = this_ptr ? Z_OBJ_P(this_ptr) : NULL; switch (type) { case zephir_fcall_parent: - -#if PHP_VERSION_ID >= 80000 if (ce && Z_TYPE_P(func) == IS_STRING) { fcic->function_handler = zend_hash_find_ptr(&ce->parent->function_table, Z_STR_P(func)); - fcic->calling_scope = ce->parent; } else if (EXPECTED(calling_scope && calling_scope->parent)) { if (Z_TYPE_P(func) == IS_STRING) { @@ -8614,7 +8398,7 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze } else { return; } -#endif + if (UNEXPECTED(!calling_scope || !calling_scope->parent)) { return; } @@ -8623,7 +8407,6 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze break; case zephir_fcall_static: -#if PHP_VERSION_ID >= 80000 if (ce && Z_TYPE_P(func) == IS_STRING) { fcic->function_handler = zend_hash_find_ptr(&ce->function_table, Z_STR_P(func)); fcic->calling_scope = ce; @@ -8631,17 +8414,10 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze fcic->function_handler = zend_hash_find_ptr(&calling_scope->function_table, Z_STR_P(func)); fcic->calling_scope = called_scope; } -#else - fcic->calling_scope = called_scope; - if (UNEXPECTED(!calling_scope)) { - return; - } -#endif break; case zephir_fcall_self: -#if PHP_VERSION_ID >= 80000 if (ce && Z_TYPE_P(func) == IS_STRING) { fcic->function_handler = zend_hash_find_ptr(&ce->function_table, Z_STR_P(func)); fcic->calling_scope = ce; @@ -8652,13 +8428,9 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze //fcic->called_scope = zend_get_called_scope(EG(current_execute_data)); fcic->calling_scope = calling_scope; } -#else - fcic->calling_scope = calling_scope; -#endif break; case zephir_fcall_ce: -#if PHP_VERSION_ID >= 80000 if (ce && Z_TYPE_P(func) == IS_STRING) { fcic->function_handler = zend_hash_find_ptr(&ce->function_table, Z_STR_P(func)); @@ -8667,7 +8439,6 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze fcic->function_handler = zend_hash_find_ptr(&calling_scope->function_table, Z_STR_P(func)); fcic->calling_scope = calling_scope; } -#endif // TODO: Check for PHP 7.4 and PHP 8.0, as it rewrite from above fcic->calling_scope = ce; fcic->called_scope = ce; @@ -8676,11 +8447,7 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze case zephir_fcall_function: case zephir_fcall_method: if (Z_TYPE_P(func) == IS_OBJECT) { -#if PHP_VERSION_ID >= 80000 if (Z_OBJ_HANDLER_P(func, get_closure) && Z_OBJ_HANDLER_P(func, get_closure)(Z_OBJ_P(func), &fcic->calling_scope, &fcic->function_handler, &fcic->object, 0) == SUCCESS) { -#else - if (Z_OBJ_HANDLER_P(func, get_closure) && Z_OBJ_HANDLER_P(func, get_closure)(func, &fcic->calling_scope, &fcic->function_handler, &fcic->object) == SUCCESS) { -#endif fcic->called_scope = fcic->calling_scope; break; } @@ -8688,11 +8455,9 @@ static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, ze return; } -#if PHP_VERSION_ID >= 80000 if (ce && Z_TYPE_P(func) == IS_STRING) { fcic->function_handler = zend_hash_find_ptr(&ce->function_table, Z_STR_P(func)); } -#endif fcic->calling_scope = this_ptr ? Z_OBJCE_P(this_ptr) : NULL; fcic->called_scope = fcic->calling_scope; break; @@ -8759,12 +8524,7 @@ static int zephir_call_user_function( ZVAL_COPY_VALUE(&fci.function_name, function_name); fci.retval = retval_ptr ? retval_ptr : &local_retval_ptr; fci.param_count = param_count; - -#if PHP_VERSION_ID < 80000 - fci.no_separation = 1; -#else fci.named_params = NULL; -#endif if (cache_entry && *cache_entry) { /* We have a cache record, initialize scope */ @@ -8778,22 +8538,18 @@ static int zephir_call_user_function( /* The caller is interested in caching OR we have the call cache enabled */ resolve_callable(&callable, type, (object_pp && type != zephir_fcall_ce ? Z_OBJCE_P(object_pp) : obj_ce), object_pp, function_name); -#if PHP_VERSION_ID >= 80000 - char *is_callable_error = NULL; - zend_execute_data *frame = EG(current_execute_data); + char *is_callable_error = NULL; + zend_execute_data *frame = EG(current_execute_data); if (obj_ce || !zend_is_callable_at_frame(&callable, fci.object, frame, 0, &fcic, &is_callable_error)) { - if (is_callable_error) { - zend_error(E_WARNING, "%s", is_callable_error); - efree(is_callable_error); + if (is_callable_error) { + zend_error(E_WARNING, "%s", is_callable_error); + efree(is_callable_error); - return FAILURE; - } + return FAILURE; + } populate_fcic(&fcic, type, obj_ce, object_pp, function_name, called_scope); } -#else - zend_is_callable_ex(&callable, fci.object, IS_CALLABLE_CHECK_SILENT, NULL, &fcic, NULL); -#endif } #ifdef _MSC_VER @@ -8808,12 +8564,9 @@ static int zephir_call_user_function( } fci.params = p; - -#if PHP_VERSION_ID >= 80000 if (!fcic.function_handler) { ZVAL_COPY_VALUE(&fci.function_name, &callable); } -#endif status = zend_call_function(&fci, &fcic); @@ -9002,29 +8755,6 @@ static int zephir_call_user_func_array_noex(zval *return_value, zval *handler, z return FAILURE; } -#if PHP_VERSION_ID < 80000 - zend_fcall_info_init(handler, 0, &fci, &fci_cache, NULL, &is_callable_error); - - if (is_callable_error) { - zend_error(E_WARNING, "%s", is_callable_error); - efree(is_callable_error); - } else { - status = SUCCESS; - } - - if (status == SUCCESS) { - zend_fcall_info_args(&fci, params); - - fci.retval = return_value; - zend_call_function(&fci, &fci_cache); - - zend_fcall_info_args_clear(&fci, 1); - } - - if (EG(exception)) { - status = SUCCESS; - } -#else zend_execute_data *frame = EG(current_execute_data); if (!zend_is_callable_at_frame(handler, NULL, frame, 0, &fci_cache, &is_callable_error)) { if (is_callable_error) { @@ -9046,7 +8776,6 @@ static int zephir_call_user_func_array_noex(zval *return_value, zval *handler, z zend_fcall_info_args(&fci, params); status = zend_call_function(&fci, &fci_cache); zend_fcall_info_args_clear(&fci, 1); -#endif return status; } @@ -9064,11 +8793,7 @@ static void zephir_eval_php(zval *str, zval *retval_ptr, char *context) #if PHP_VERSION_ID >= 80200 new_op_array = zend_compile_string(Z_STR_P(str), context, ZEND_COMPILE_POSITION_AFTER_OPEN_TAG); #else -#if PHP_VERSION_ID >= 80000 new_op_array = zend_compile_string(Z_STR_P(str), context); -#else - new_op_array = zend_compile_string(str, context); -#endif #endif CG(compiler_options) = original_compiler_options; @@ -13832,22 +13557,15 @@ static PHP_METHOD(phalcon_0__closure, __invoke) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *element, element_sub, _0; - zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &element); - - ZEPHIR_CALL_FUNCTION(&_0, "mb_strtolower", NULL, 10, element); zephir_check_call_status(); zephir_ucfirst(return_value, &_0); @@ -13875,25 +13593,18 @@ static PHP_METHOD(phalcon_10__closure, __invoke) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *action, action_sub, _0; - zval *this_ptr = getThis(); ZVAL_UNDEF(&action_sub); ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(action) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &action); - - ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "-"); - zephir_uncamelize(return_value, action, &_0 ); + zephir_uncamelize(return_value, action, &_0); RETURN_MM(); } @@ -13917,27 +13628,19 @@ ZEPHIR_INIT_CLASS(phalcon_11__closure) static PHP_METHOD(phalcon_11__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&file_sub); ZVAL_UNDEF(&line_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) Z_PARAM_ZVAL(file) Z_PARAM_ZVAL(line) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -13961,7 +13664,6 @@ ZEPHIR_INIT_CLASS(phalcon_12__closure) static PHP_METHOD(phalcon_12__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); @@ -13969,8 +13671,6 @@ static PHP_METHOD(phalcon_12__closure, __invoke) ZVAL_UNDEF(&line_sub); ZVAL_UNDEF(&context_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) @@ -13978,12 +13678,7 @@ static PHP_METHOD(phalcon_12__closure, __invoke) Z_PARAM_ZVAL(line) Z_PARAM_ZVAL(context) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -14008,20 +13703,12 @@ static PHP_METHOD(phalcon_13__closure, __invoke) { zend_bool _0; zval *element, element_sub; - zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &element); - - _0 = Z_TYPE_P(element) == IS_LONG; if (!(_0)) { _0 = Z_TYPE_P(element) == IS_STRING; @@ -14050,20 +13737,12 @@ static PHP_METHOD(phalcon_14__closure, __invoke) { zend_bool _0; zval *element, element_sub; - zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &element); - - _0 = Z_TYPE_P(element) == IS_LONG; if (!(_0)) { _0 = Z_TYPE_P(element) == IS_STRING; @@ -14091,27 +13770,19 @@ ZEPHIR_INIT_CLASS(phalcon_1__closure) static PHP_METHOD(phalcon_1__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&file_sub); ZVAL_UNDEF(&line_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) Z_PARAM_ZVAL(file) Z_PARAM_ZVAL(line) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -14135,7 +13806,6 @@ ZEPHIR_INIT_CLASS(phalcon_2__closure) static PHP_METHOD(phalcon_2__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); @@ -14143,8 +13813,6 @@ static PHP_METHOD(phalcon_2__closure, __invoke) ZVAL_UNDEF(&line_sub); ZVAL_UNDEF(&context_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) @@ -14152,12 +13820,7 @@ static PHP_METHOD(phalcon_2__closure, __invoke) Z_PARAM_ZVAL(line) Z_PARAM_ZVAL(context) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -14181,27 +13844,19 @@ ZEPHIR_INIT_CLASS(phalcon_3__closure) static PHP_METHOD(phalcon_3__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&file_sub); ZVAL_UNDEF(&line_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) Z_PARAM_ZVAL(file) Z_PARAM_ZVAL(line) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -14225,7 +13880,6 @@ ZEPHIR_INIT_CLASS(phalcon_4__closure) static PHP_METHOD(phalcon_4__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); @@ -14233,8 +13887,6 @@ static PHP_METHOD(phalcon_4__closure, __invoke) ZVAL_UNDEF(&line_sub); ZVAL_UNDEF(&context_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) @@ -14242,12 +13894,7 @@ static PHP_METHOD(phalcon_4__closure, __invoke) Z_PARAM_ZVAL(line) Z_PARAM_ZVAL(context) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -14271,27 +13918,19 @@ ZEPHIR_INIT_CLASS(phalcon_5__closure) static PHP_METHOD(phalcon_5__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); ZVAL_UNDEF(&file_sub); ZVAL_UNDEF(&line_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(4, 4) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) Z_PARAM_ZVAL(file) Z_PARAM_ZVAL(line) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(4, 0, &number, &message, &file, &line); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -14315,7 +13954,6 @@ ZEPHIR_INIT_CLASS(phalcon_6__closure) static PHP_METHOD(phalcon_6__closure, __invoke) { zval *number, number_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, __$true; - zval *this_ptr = getThis(); ZVAL_UNDEF(&number_sub); ZVAL_UNDEF(&message_sub); @@ -14323,8 +13961,6 @@ static PHP_METHOD(phalcon_6__closure, __invoke) ZVAL_UNDEF(&line_sub); ZVAL_UNDEF(&context_sub); ZVAL_BOOL(&__$true, 1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(5, 5) Z_PARAM_ZVAL(number) Z_PARAM_ZVAL(message) @@ -14332,12 +13968,7 @@ static PHP_METHOD(phalcon_6__closure, __invoke) Z_PARAM_ZVAL(line) Z_PARAM_ZVAL(context) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(5, 0, &number, &message, &file, &line, &context); - - ZEPHIR_GLOBAL(warning).enable = zend_is_true(&__$true); } @@ -14361,20 +13992,12 @@ ZEPHIR_INIT_CLASS(phalcon_7__closure) static PHP_METHOD(phalcon_7__closure, __invoke) { zval *file, file_sub; - zval *this_ptr = getThis(); ZVAL_UNDEF(&file_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(file) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &file); - - RETURN_BOOL(1); } @@ -14400,28 +14023,21 @@ static PHP_METHOD(phalcon_8__closure, __invoke) zend_bool _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *element, element_sub, _0, _2; - zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &element); - - - ZEPHIR_OBS_VAR(&_0); + zephir_memory_observe(&_0); zephir_array_fetch_long(&_0, element, 0, PH_NOISY, "phalcon/Filter/Validation.zep", 81); _1 = Z_TYPE_P(&_0) != IS_ARRAY; if (!(_1)) { - ZEPHIR_OBS_VAR(&_2); + zephir_memory_observe(&_2); zephir_array_fetch_long(&_2, element, 1, PH_NOISY, "phalcon/Filter/Validation.zep", 81); _1 = !(zephir_instance_of_ev(&_2, phalcon_filter_validation_abstractcombinedfieldsvalidator_ce)); } @@ -14450,28 +14066,21 @@ static PHP_METHOD(phalcon_9__closure, __invoke) zend_bool _1; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *element, element_sub, _0, _2; - zval *this_ptr = getThis(); ZVAL_UNDEF(&element_sub); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(element) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &element); - - - ZEPHIR_OBS_VAR(&_0); + zephir_memory_observe(&_0); zephir_array_fetch_long(&_0, element, 0, PH_NOISY, "phalcon/Filter/Validation.zep", 88); _1 = Z_TYPE_P(&_0) == IS_ARRAY; if (_1) { - ZEPHIR_OBS_VAR(&_2); + zephir_memory_observe(&_2); zephir_array_fetch_long(&_2, element, 1, PH_NOISY, "phalcon/Filter/Validation.zep", 88); _1 = zephir_instance_of_ev(&_2, phalcon_filter_validation_abstractcombinedfieldsvalidator_ce); } @@ -14531,23 +14140,16 @@ static PHP_METHOD(Phalcon_Tag, appendTitle) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *title, title_sub, _0, _1$$3; - zval *this_ptr = getThis(); ZVAL_UNDEF(&title_sub); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(title) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &title); - - zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("documentAppendTitle"), PH_NOISY_CC | PH_READONLY); if (Z_TYPE_P(&_0) == IS_NULL) { ZEPHIR_INIT_VAR(&_1$$3); @@ -14568,22 +14170,15 @@ static PHP_METHOD(Phalcon_Tag, checkField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "checkbox"); ZEPHIR_RETURN_CALL_SELF("inputfieldchecked", &_0, 0, &_1, parameters); @@ -14597,22 +14192,15 @@ static PHP_METHOD(Phalcon_Tag, colorField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "color"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -14626,22 +14214,15 @@ static PHP_METHOD(Phalcon_Tag, dateField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "date"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -14655,22 +14236,15 @@ static PHP_METHOD(Phalcon_Tag, dateTimeField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "datetime"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -14684,22 +14258,15 @@ static PHP_METHOD(Phalcon_Tag, dateTimeLocalField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "datetime-local"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -14713,20 +14280,15 @@ static PHP_METHOD(Phalcon_Tag, displayTo) zend_long ZEPHIR_LAST_CALL_STATUS; zval *id_param = NULL, *value, value_sub; zval id; - zval *this_ptr = getThis(); ZVAL_UNDEF(&id); ZVAL_UNDEF(&value_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_STR(id) Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 2, 0, &id_param, &value); if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string")); @@ -14737,8 +14299,6 @@ static PHP_METHOD(Phalcon_Tag, displayTo) } else { ZEPHIR_INIT_VAR(&id); } - - ZEPHIR_CALL_SELF(NULL, "setdefault", NULL, 0, &id, value); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -14750,22 +14310,15 @@ static PHP_METHOD(Phalcon_Tag, emailField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "email"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -14775,9 +14328,6 @@ static PHP_METHOD(Phalcon_Tag, emailField) static PHP_METHOD(Phalcon_Tag, endForm) { - zval *this_ptr = getThis(); - - RETURN_STRING(""); } @@ -14788,22 +14338,15 @@ static PHP_METHOD(Phalcon_Tag, fileField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "file"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -14816,7 +14359,6 @@ static PHP_METHOD(Phalcon_Tag, formLegacy) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *parameters = NULL, parameters_sub, params, paramsAction, action, code, _3, _0$$6, _1$$7, _2$$8; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(¶ms); @@ -14827,19 +14369,13 @@ static PHP_METHOD(Phalcon_Tag, formLegacy) ZVAL_UNDEF(&_0$$6); ZVAL_UNDEF(&_1$$7); ZVAL_UNDEF(&_2$$8); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); ZEPHIR_SEPARATE_PARAM(parameters); - - if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 1, 0); @@ -14847,7 +14383,7 @@ static PHP_METHOD(Phalcon_Tag, formLegacy) } else { ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_OBS_VAR(¶msAction); + zephir_memory_observe(¶msAction); if (!(zephir_array_isset_long_fetch(¶msAction, ¶ms, 0, 0))) { ZEPHIR_OBS_NVAR(¶msAction); zephir_array_isset_string_fetch(¶msAction, ¶ms, SL("action"), 0); @@ -14889,7 +14425,6 @@ static PHP_METHOD(Phalcon_Tag, friendlyTitle) zend_bool lowercase; zval *text_param = NULL, *separator_param = NULL, *lowercase_param = NULL, *replace = NULL, replace_sub, __$null, ex, _2, _0$$3, _1$$3, _3$$4, _4$$4; zval text, separator; - zval *this_ptr = getThis(); ZVAL_UNDEF(&text); ZVAL_UNDEF(&separator); @@ -14901,7 +14436,6 @@ static PHP_METHOD(Phalcon_Tag, friendlyTitle) ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_3$$4); ZVAL_UNDEF(&_4$$4); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 4) Z_PARAM_STR(text) @@ -14910,10 +14444,8 @@ static PHP_METHOD(Phalcon_Tag, friendlyTitle) Z_PARAM_BOOL(lowercase) Z_PARAM_ZVAL_OR_NULL(replace) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 3, &text_param, &separator_param, &lowercase_param, &replace); zephir_get_strval(&text, text_param); if (!separator_param) { @@ -14925,15 +14457,11 @@ static PHP_METHOD(Phalcon_Tag, friendlyTitle) if (!lowercase_param) { lowercase = 1; } else { - lowercase = zephir_get_boolval(lowercase_param); - } + } if (!replace) { replace = &replace_sub; replace = &__$null; } - - - /* try_start_1: */ ZEPHIR_INIT_VAR(&_0$$3); @@ -14965,7 +14493,7 @@ static PHP_METHOD(Phalcon_Tag, friendlyTitle) object_init_ex(&_3$$4, phalcon_tag_exception_ce); ZEPHIR_CALL_METHOD(&_4$$4, &ex, "getmessage", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 32, &_4$$4); + ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 33, &_4$$4); zephir_check_call_status(); zephir_throw_exception_debug(&_3$$4, "phalcon/Tag.zep", 308); ZEPHIR_MM_RESTORE(); @@ -14978,7 +14506,6 @@ static PHP_METHOD(Phalcon_Tag, getDocType) { zval _0, _1$$3, _2$$4, _3$$4, _4$$5, _5$$5, _6$$6, _7$$6, _8$$7, _9$$7, _10$$8, _11$$8, _12$$9, _13$$9, _14$$10, _15$$10, _16$$11, _17$$11, _18$$12; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); @@ -14999,9 +14526,8 @@ static PHP_METHOD(Phalcon_Tag, getDocType) ZVAL_UNDEF(&_16$$11); ZVAL_UNDEF(&_17$$11); ZVAL_UNDEF(&_18$$12); - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("documentType"), PH_NOISY_CC | PH_READONLY); do { @@ -15092,24 +14618,17 @@ static PHP_METHOD(Phalcon_Tag, getEscaper) zend_long ZEPHIR_LAST_CALL_STATUS; zval *params_param = NULL, autoescape; zval params; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶ms); ZVAL_UNDEF(&autoescape); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ARRAY(params) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶ms_param); ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param); - - - ZEPHIR_OBS_VAR(&autoescape); + zephir_memory_observe(&autoescape); if (!(zephir_array_isset_string_fetch(&autoescape, ¶ms, SL("escape"), 0))) { ZEPHIR_OBS_NVAR(&autoescape); zephir_read_static_property_ce(&autoescape, phalcon_tag_ce, SL("autoEscape"), PH_NOISY_CC); @@ -15127,18 +14646,15 @@ static PHP_METHOD(Phalcon_Tag, getDI) zval di; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; - zval *this_ptr = getThis(); ZVAL_UNDEF(&di); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - - ZEPHIR_MM_GROW(); - - ZEPHIR_OBS_VAR(&di); + zephir_memory_observe(&di); zephir_read_static_property_ce(&di, phalcon_tag_ce, SL("container"), PH_NOISY_CC); if (Z_TYPE_P(&di) == IS_NULL) { - ZEPHIR_CALL_CE_STATIC(&di, phalcon_di_di_ce, "getdefault", &_0, 0); + ZEPHIR_CALL_CE_STATIC(&di, phalcon_di_di_ce, "getdefault", NULL, 0); zephir_check_call_status(); } RETURN_CCTOR(&di); @@ -15149,17 +14665,15 @@ static PHP_METHOD(Phalcon_Tag, getEscaperService) zval escaper, container, _0$$3, _1$$3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); ZVAL_UNDEF(&escaper); ZVAL_UNDEF(&container); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - - ZEPHIR_MM_GROW(); - - ZEPHIR_OBS_VAR(&escaper); + zephir_memory_observe(&escaper); zephir_read_static_property_ce(&escaper, phalcon_tag_ce, SL("escaperService"), PH_NOISY_CC); if (Z_TYPE_P(&escaper) != IS_OBJECT) { ZEPHIR_CALL_SELF(&container, "getdi", NULL, 0); @@ -15186,7 +14700,6 @@ static PHP_METHOD(Phalcon_Tag, getTitle) zend_long ZEPHIR_LAST_CALL_STATUS; zval *prepend_param = NULL, *append_param = NULL, __$true, items, output, title, documentTitle, documentAppendTitle, documentPrependTitle, documentTitleSeparator, escaper, _0, _2, _3, _4$$3, _6$$3, _5$$4, tmp$$5, *_7$$5, _8$$5, _9$$6, _11$$7, _13$$9, _15$$9, _14$$10, *_16$$11, _17$$11, _18$$12, _20$$13; zend_bool prepend, append; - zval *this_ptr = getThis(); ZVAL_BOOL(&__$true, 1); ZVAL_UNDEF(&items); @@ -15214,30 +14727,22 @@ static PHP_METHOD(Phalcon_Tag, getTitle) ZVAL_UNDEF(&_18$$12); ZVAL_UNDEF(&_20$$13); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL Z_PARAM_BOOL(prepend) Z_PARAM_BOOL(append) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 0, 2, &prepend_param, &append_param); if (!prepend_param) { prepend = 1; } else { - prepend = zephir_get_boolval(prepend_param); - } + } if (!append_param) { append = 1; } else { - append = zephir_get_boolval(append_param); - } - - + } ZEPHIR_INIT_VAR(&_1); zephir_create_array(&_1, 1, 0); zephir_array_update_string(&_1, SL("escape"), &__$true, PH_COPY | PH_SEPARATE); @@ -15261,11 +14766,11 @@ static PHP_METHOD(Phalcon_Tag, getTitle) array_init(&_5$$4); zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("documentPrependTitle"), &_5$$4); } - ZEPHIR_OBS_VAR(&_6$$3); + zephir_memory_observe(&_6$$3); zephir_read_static_property_ce(&_6$$3, phalcon_tag_ce, SL("documentPrependTitle"), PH_NOISY_CC); ZEPHIR_CPY_WRT(&documentPrependTitle, &_6$$3); if (!(ZEPHIR_IS_EMPTY(&documentPrependTitle))) { - ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 295, &documentPrependTitle); + ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 297, &documentPrependTitle); zephir_check_call_status(); zephir_is_iterable(&tmp$$5, 0, "phalcon/Tag.zep", 443); if (Z_TYPE_P(&tmp$$5) == IS_ARRAY) { @@ -15308,7 +14813,7 @@ static PHP_METHOD(Phalcon_Tag, getTitle) array_init(&_14$$10); zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("documentAppendTitle"), &_14$$10); } - ZEPHIR_OBS_VAR(&_15$$9); + zephir_memory_observe(&_15$$9); zephir_read_static_property_ce(&_15$$9, phalcon_tag_ce, SL("documentAppendTitle"), PH_NOISY_CC); ZEPHIR_CPY_WRT(&documentAppendTitle, &_15$$9); if (!(ZEPHIR_IS_EMPTY(&documentAppendTitle))) { @@ -15357,12 +14862,8 @@ static PHP_METHOD(Phalcon_Tag, getTitle) static PHP_METHOD(Phalcon_Tag, getTitleSeparator) { zval _0; - zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); - - - zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("documentTitleSeparator"), PH_NOISY_CC | PH_READONLY); RETURN_CTORW(&_0); } @@ -15372,17 +14873,15 @@ static PHP_METHOD(Phalcon_Tag, getUrlService) zval url, container, _0$$3, _1$$3; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); ZVAL_UNDEF(&url); ZVAL_UNDEF(&container); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); - - ZEPHIR_MM_GROW(); - - ZEPHIR_OBS_VAR(&url); + zephir_memory_observe(&url); zephir_read_static_property_ce(&url, phalcon_tag_ce, SL("urlService"), PH_NOISY_CC); if (Z_TYPE_P(&url) != IS_OBJECT) { ZEPHIR_CALL_SELF(&container, "getdi", NULL, 0); @@ -15406,24 +14905,19 @@ static PHP_METHOD(Phalcon_Tag, getValue) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval params; zval *name, name_sub, *params_param = NULL, _POST, value, _0$$3; - zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); ZVAL_UNDEF(&_POST); ZVAL_UNDEF(&value); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(¶ms); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ZVAL(name) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(params) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_get_global(&_POST, SL("_POST")); zephir_fetch_params(1, 1, 1, &name, ¶ms_param); if (!params_param) { @@ -15432,9 +14926,7 @@ static PHP_METHOD(Phalcon_Tag, getValue) } else { zephir_get_arrval(¶ms, params_param); } - - - ZEPHIR_OBS_VAR(&value); + zephir_memory_observe(&value); if (!(zephir_array_isset_string_fetch(&value, ¶ms, SL("value"), 0))) { ZEPHIR_OBS_NVAR(&value); zephir_read_static_property_ce(&_0$$3, phalcon_tag_ce, SL("displayValues"), PH_NOISY_CC | PH_READONLY); @@ -15452,23 +14944,15 @@ static PHP_METHOD(Phalcon_Tag, hasValue) { zend_bool _1; zval *name, name_sub, _POST, _0; - zval *this_ptr = getThis(); ZVAL_UNDEF(&name_sub); ZVAL_UNDEF(&_POST); ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(name) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_get_global(&_POST, SL("_POST")); zephir_fetch_params_without_memory_grow(1, 0, &name); - - zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("displayValues"), PH_NOISY_CC | PH_READONLY); _1 = zephir_array_isset(&_0, name); if (!(_1)) { @@ -15483,22 +14967,15 @@ static PHP_METHOD(Phalcon_Tag, hiddenField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "hidden"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -15512,7 +14989,6 @@ static PHP_METHOD(Phalcon_Tag, image) zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool local; zval *parameters = NULL, parameters_sub, *local_param = NULL, __$null, params, code, src, _5, _6, _0$$5, _1$$8, _2$$9, _3$$9, _4$$9; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_NULL(&__$null); @@ -15526,17 +15002,14 @@ static PHP_METHOD(Phalcon_Tag, image) ZVAL_UNDEF(&_2$$9); ZVAL_UNDEF(&_3$$9); ZVAL_UNDEF(&_4$$9); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(parameters) Z_PARAM_BOOL(local) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 0, 2, ¶meters, &local_param); if (!parameters) { parameters = ¶meters_sub; @@ -15545,10 +15018,7 @@ static PHP_METHOD(Phalcon_Tag, image) if (!local_param) { local = 1; } else { - local = zephir_get_boolval(local_param); - } - - + } if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 1, 0); @@ -15556,13 +15026,13 @@ static PHP_METHOD(Phalcon_Tag, image) } else { ZEPHIR_CPY_WRT(¶ms, parameters); if (zephir_array_isset_long(¶ms, 1)) { - ZEPHIR_OBS_VAR(&_0$$5); + zephir_memory_observe(&_0$$5); zephir_array_fetch_long(&_0$$5, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 581); local = zephir_get_boolval(&_0$$5); } } if (!(zephir_array_isset_string(¶ms, SL("src")))) { - ZEPHIR_OBS_VAR(&src); + zephir_memory_observe(&src); if (zephir_array_isset_long_fetch(&src, ¶ms, 0, 0)) { zephir_array_update_string(¶ms, SL("src"), &src, PH_COPY | PH_SEPARATE); } else { @@ -15598,23 +15068,16 @@ static PHP_METHOD(Phalcon_Tag, imageInput) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1, _2; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "image"); ZVAL_BOOL(&_2, 1); @@ -15629,7 +15092,6 @@ static PHP_METHOD(Phalcon_Tag, javascriptInclude) zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool local, _3; zval *parameters = NULL, parameters_sub, *local_param = NULL, __$null, params, code, _4, _11, _12, _0$$3, _1$$5, _2$$7, _5$$8, _6$$10, _7$$11, _8$$12, _9$$12, _10$$12; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_NULL(&__$null); @@ -15647,17 +15109,14 @@ static PHP_METHOD(Phalcon_Tag, javascriptInclude) ZVAL_UNDEF(&_8$$12); ZVAL_UNDEF(&_9$$12); ZVAL_UNDEF(&_10$$12); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(parameters) Z_PARAM_BOOL(local) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 0, 2, ¶meters, &local_param); if (!parameters) { parameters = ¶meters_sub; @@ -15666,10 +15125,7 @@ static PHP_METHOD(Phalcon_Tag, javascriptInclude) if (!local_param) { local = 1; } else { - local = zephir_get_boolval(local_param); - } - - + } if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 2, 0); @@ -15681,12 +15137,12 @@ static PHP_METHOD(Phalcon_Tag, javascriptInclude) ZEPHIR_CPY_WRT(¶ms, parameters); } if (zephir_array_isset_long(¶ms, 1)) { - ZEPHIR_OBS_VAR(&_1$$5); + zephir_memory_observe(&_1$$5); zephir_array_fetch_long(&_1$$5, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 650); local = zephir_get_boolval(&_1$$5); } else { if (zephir_array_isset_string(¶ms, SL("local"))) { - ZEPHIR_OBS_VAR(&_2$$7); + zephir_memory_observe(&_2$$7); zephir_array_fetch_string(&_2$$7, ¶ms, SL("local"), PH_NOISY, "phalcon/Tag.zep", 653); local = zephir_get_boolval(&_2$$7); zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); @@ -15737,7 +15193,6 @@ static PHP_METHOD(Phalcon_Tag, linkTo) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *parameters, parameters_sub, *text = NULL, text_sub, *local = NULL, local_sub, __$null, __$true, params, action, query, url, code, _0, _1, _2; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&text_sub); @@ -15752,7 +15207,6 @@ static PHP_METHOD(Phalcon_Tag, linkTo) ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 3) Z_PARAM_ZVAL(parameters) @@ -15760,10 +15214,8 @@ static PHP_METHOD(Phalcon_Tag, linkTo) Z_PARAM_ZVAL_OR_NULL(text) Z_PARAM_ZVAL(local) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 2, ¶meters, &text, &local); if (!text) { text = &text_sub; @@ -15777,8 +15229,6 @@ static PHP_METHOD(Phalcon_Tag, linkTo) } else { ZEPHIR_SEPARATE_PARAM(local); } - - if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 3, 0); @@ -15788,7 +15238,7 @@ static PHP_METHOD(Phalcon_Tag, linkTo) } else { ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_OBS_VAR(&action); + zephir_memory_observe(&action); if (!(zephir_array_isset_long_fetch(&action, ¶ms, 0, 0))) { ZEPHIR_OBS_NVAR(&action); if (!(zephir_array_isset_string_fetch(&action, ¶ms, SL("action"), 0))) { @@ -15818,7 +15268,7 @@ static PHP_METHOD(Phalcon_Tag, linkTo) zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); } } - ZEPHIR_OBS_VAR(&query); + zephir_memory_observe(&query); if (zephir_array_isset_string_fetch(&query, ¶ms, SL("query"), 0)) { zephir_array_unset_string(¶ms, SL("query"), PH_SEPARATE); } else { @@ -15846,22 +15296,15 @@ static PHP_METHOD(Phalcon_Tag, monthField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "month"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -15875,22 +15318,15 @@ static PHP_METHOD(Phalcon_Tag, numericField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "number"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -15904,22 +15340,15 @@ static PHP_METHOD(Phalcon_Tag, passwordField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "password"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -15931,23 +15360,16 @@ static PHP_METHOD(Phalcon_Tag, prependTitle) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *title, title_sub, _0, _1$$3; - zval *this_ptr = getThis(); ZVAL_UNDEF(&title_sub); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(title) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &title); - - zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("documentPrependTitle"), PH_NOISY_CC | PH_READONLY); if (Z_TYPE_P(&_0) == IS_NULL) { ZEPHIR_INIT_VAR(&_1$$3); @@ -15969,7 +15391,6 @@ static PHP_METHOD(Phalcon_Tag, preload) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *parameters, parameters_sub, attributes, container, header, href, link, params, response, _2, _3, _0$$3, _4$$7, _5$$5, _6$$5, _7$$5, _8$$5, _9$$5; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&attributes); @@ -15989,18 +15410,12 @@ static PHP_METHOD(Phalcon_Tag, preload) ZVAL_UNDEF(&_8$$5); ZVAL_UNDEF(&_9$$5); ZVAL_UNDEF(&_10$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(¶ms); array_init(¶ms); if (Z_TYPE_P(parameters) != IS_ARRAY) { @@ -16011,7 +15426,7 @@ static PHP_METHOD(Phalcon_Tag, preload) } else { ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_OBS_VAR(&href); + zephir_memory_observe(&href); zephir_array_isset_long_fetch(&href, ¶ms, 0, 0); ZEPHIR_CALL_SELF(&container, "getdi", NULL, 0); zephir_check_call_status(); @@ -16025,7 +15440,7 @@ static PHP_METHOD(Phalcon_Tag, preload) } if (_1) { if (zephir_array_isset_long(¶ms, 1)) { - ZEPHIR_OBS_VAR(&attributes); + zephir_memory_observe(&attributes); zephir_array_fetch_long(&attributes, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 840); } else { ZEPHIR_INIT_VAR(&_4$$7); @@ -16047,7 +15462,7 @@ static PHP_METHOD(Phalcon_Tag, preload) zephir_fast_str_replace(&_5$$5, &_6$$5, &_7$$5, &href); ZEPHIR_INIT_VAR(&_8$$5); ZVAL_STRING(&_8$$5, "preload"); - ZEPHIR_CALL_METHOD(NULL, &link, "__construct", NULL, 498, &_8$$5, &_5$$5, &attributes); + ZEPHIR_CALL_METHOD(NULL, &link, "__construct", NULL, 499, &_8$$5, &_5$$5, &attributes); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_8$$5); object_init_ex(&_8$$5, phalcon_html_link_serializer_header_ce); @@ -16059,7 +15474,7 @@ static PHP_METHOD(Phalcon_Tag, preload) ZEPHIR_INIT_VAR(&_10$$5); zephir_create_array(&_10$$5, 1, 0); zephir_array_fast_append(&_10$$5, &link); - ZEPHIR_CALL_METHOD(&_9$$5, &_8$$5, "serialize", NULL, 499, &_10$$5); + ZEPHIR_CALL_METHOD(&_9$$5, &_8$$5, "serialize", NULL, 500, &_10$$5); zephir_check_call_status(); ZEPHIR_INIT_VAR(&header); ZEPHIR_CONCAT_SV(&header, "Link: ", &_9$$5); @@ -16075,22 +15490,15 @@ static PHP_METHOD(Phalcon_Tag, radioField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "radio"); ZEPHIR_RETURN_CALL_SELF("inputfieldchecked", &_0, 0, &_1, parameters); @@ -16104,22 +15512,15 @@ static PHP_METHOD(Phalcon_Tag, rangeField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "range"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -16138,7 +15539,6 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) zval attributes; zval *code_param = NULL, *attributes_param = NULL, __$null, order, escaper, attrs, attribute, value, escaped, key, newCode, *_0, _1, *_4, _5, _8, *_9, _10, _20$$12, _15$$13, _16$$13, _17$$13, _27$$17, _23$$18, _24$$18, _25$$18; zval code; - zval *this_ptr = getThis(); ZVAL_UNDEF(&code); ZVAL_NULL(&__$null); @@ -16163,16 +15563,12 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) ZVAL_UNDEF(&_24$$18); ZVAL_UNDEF(&_25$$18); ZVAL_UNDEF(&attributes); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_STR(code) Z_PARAM_ARRAY(attributes) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 2, 0, &code_param, &attributes_param); if (UNEXPECTED(Z_TYPE_P(code_param) != IS_STRING && Z_TYPE_P(code_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'code' must be of the type string")); @@ -16184,8 +15580,6 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) ZEPHIR_INIT_VAR(&code); } ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - - ZEPHIR_INIT_VAR(&order); zephir_create_array(&order, 10, 0); zephir_array_update_string(&order, SL("rel"), &__$null, PH_COPY | PH_SEPARATE); @@ -16311,7 +15705,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) zephir_gettype(&_16$$13, &value); ZEPHIR_INIT_NVAR(&_17$$13); ZEPHIR_CONCAT_SVSVS(&_17$$13, "Value at index: '", &key, "' type: '", &_16$$13, "' cannot be rendered"); - ZEPHIR_CALL_METHOD(NULL, &_15$$13, "__construct", &_18, 32, &_17$$13); + ZEPHIR_CALL_METHOD(NULL, &_15$$13, "__construct", &_18, 33, &_17$$13); zephir_check_call_status(); zephir_throw_exception_debug(&_15$$13, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); @@ -16357,7 +15751,7 @@ static PHP_METHOD(Phalcon_Tag, renderAttributes) zephir_gettype(&_24$$18, &value); ZEPHIR_INIT_NVAR(&_25$$18); ZEPHIR_CONCAT_SVSVS(&_25$$18, "Value at index: '", &key, "' type: '", &_24$$18, "' cannot be rendered"); - ZEPHIR_CALL_METHOD(NULL, &_23$$18, "__construct", &_18, 32, &_25$$18); + ZEPHIR_CALL_METHOD(NULL, &_23$$18, "__construct", &_18, 33, &_25$$18); zephir_check_call_status(); zephir_throw_exception_debug(&_23$$18, "phalcon/Tag.zep", 952); ZEPHIR_MM_RESTORE(); @@ -16388,36 +15782,27 @@ static PHP_METHOD(Phalcon_Tag, renderTitle) zend_long ZEPHIR_LAST_CALL_STATUS; zval *prepend_param = NULL, *append_param = NULL, _0, _1, _2, _3; zend_bool prepend, append; - zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL Z_PARAM_BOOL(prepend) Z_PARAM_BOOL(append) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 0, 2, &prepend_param, &append_param); if (!prepend_param) { prepend = 1; } else { - prepend = zephir_get_boolval(prepend_param); - } + } if (!append_param) { append = 1; } else { - append = zephir_get_boolval(append_param); - } - - + } if (prepend) { ZVAL_BOOL(&_1, 1); } else { @@ -16440,15 +15825,13 @@ static PHP_METHOD(Phalcon_Tag, resetInput) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, _0, _1, _2; - zval *this_ptr = getThis(); ZVAL_NULL(&__$null); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); ZEPHIR_INIT_VAR(&_0); array_init(&_0); @@ -16470,22 +15853,15 @@ static PHP_METHOD(Phalcon_Tag, searchField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "search"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -16497,32 +15873,25 @@ static PHP_METHOD(Phalcon_Tag, select) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, *data = NULL, data_sub, __$null; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&data_sub); ZVAL_NULL(&__$null); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ZVAL(parameters) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(data) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 1, ¶meters, &data); if (!data) { data = &data_sub; data = &__$null; } - - - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 0, parameters, data); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", NULL, 0, parameters, data); zephir_check_call_status(); RETURN_MM(); } @@ -16531,32 +15900,25 @@ static PHP_METHOD(Phalcon_Tag, selectStatic) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, *data = NULL, data_sub, __$null; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&data_sub); ZVAL_NULL(&__$null); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ZVAL(parameters) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(data) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 1, ¶meters, &data); if (!data) { data = &data_sub; data = &__$null; } - - - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 0, parameters, data); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", NULL, 0, parameters, data); zephir_check_call_status(); RETURN_MM(); } @@ -16565,22 +15927,13 @@ static PHP_METHOD(Phalcon_Tag, setAutoescape) { zval *autoescape_param = NULL, _0; zend_bool autoescape; - zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_BOOL(autoescape) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &autoescape_param); - autoescape = zephir_get_boolval(autoescape_param); - - - ZEPHIR_INIT_ZVAL_NREF(_0); + ZVAL_UNDEF(&_0); ZVAL_BOOL(&_0, autoescape); zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("autoEscape"), &_0); } @@ -16591,20 +15944,15 @@ static PHP_METHOD(Phalcon_Tag, setDefault) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *id_param = NULL, *value, value_sub; zval id; - zval *this_ptr = getThis(); ZVAL_UNDEF(&id); ZVAL_UNDEF(&value_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_STR(id) Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 2, 0, &id_param, &value); if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string")); @@ -16615,8 +15963,6 @@ static PHP_METHOD(Phalcon_Tag, setDefault) } else { ZEPHIR_INIT_VAR(&id); } - - if (Z_TYPE_P(value) != IS_NULL) { _0$$3 = Z_TYPE_P(value) == IS_ARRAY; if (!(_0$$3)) { @@ -16637,35 +15983,27 @@ static PHP_METHOD(Phalcon_Tag, setDefaults) zend_bool merge, _0; zval *values_param = NULL, *merge_param = NULL, _1, _2$$3, _3$$3; zval values; - zval *this_ptr = getThis(); ZVAL_UNDEF(&values); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2$$3); ZVAL_UNDEF(&_3$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ARRAY(values) Z_PARAM_OPTIONAL Z_PARAM_BOOL(merge) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 1, &values_param, &merge_param); ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); if (!merge_param) { merge = 0; } else { - merge = zephir_get_boolval(merge_param); - } - - + } _0 = merge; if (_0) { - ZEPHIR_OBS_VAR(&_1); + zephir_memory_observe(&_1); zephir_read_static_property_ce(&_1, phalcon_tag_ce, SL("displayValues"), PH_NOISY_CC); _0 = Z_TYPE_P(&_1) == IS_ARRAY; } @@ -16683,20 +16021,12 @@ static PHP_METHOD(Phalcon_Tag, setDefaults) static PHP_METHOD(Phalcon_Tag, setDI) { zval *container, container_sub; - zval *this_ptr = getThis(); ZVAL_UNDEF(&container_sub); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_OBJECT_OF_CLASS(container, phalcon_di_diinterface_ce) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &container); - - zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("container"), container); } @@ -16705,32 +16035,23 @@ static PHP_METHOD(Phalcon_Tag, setDocType) zend_bool _0; zval *doctype_param = NULL, _1$$3, _2$$4; zend_long doctype; - zval *this_ptr = getThis(); ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_2$$4); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_LONG(doctype) ZEND_PARSE_PARAMETERS_END(); -#endif - - zephir_fetch_params_without_memory_grow(1, 0, &doctype_param); - doctype = zephir_get_intval(doctype_param); - - _0 = doctype < 1; if (!(_0)) { _0 = doctype > 11; } if (_0) { - ZEPHIR_INIT_ZVAL_NREF(_1$$3); + ZVAL_UNDEF(&_1$$3); ZVAL_LONG(&_1$$3, 5); zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("documentType"), &_1$$3); } else { - ZEPHIR_INIT_ZVAL_NREF(_2$$4); + ZVAL_UNDEF(&_2$$4); ZVAL_LONG(&_2$$4, doctype); zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("documentType"), &_2$$4); } @@ -16741,22 +16062,15 @@ static PHP_METHOD(Phalcon_Tag, setTitle) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *title_param = NULL; zval title; - zval *this_ptr = getThis(); ZVAL_UNDEF(&title); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(title) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &title_param); zephir_get_strval(&title, title_param); - - zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("documentTitle"), &title); ZEPHIR_MM_RESTORE(); } @@ -16766,22 +16080,15 @@ static PHP_METHOD(Phalcon_Tag, setTitleSeparator) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *titleSeparator_param = NULL; zval titleSeparator; - zval *this_ptr = getThis(); ZVAL_UNDEF(&titleSeparator); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(titleSeparator) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, &titleSeparator_param); zephir_get_strval(&titleSeparator, titleSeparator_param); - - zephir_update_static_property_ce(phalcon_tag_ce, ZEND_STRL("documentTitleSeparator"), &titleSeparator); ZEPHIR_MM_RESTORE(); } @@ -16792,7 +16099,6 @@ static PHP_METHOD(Phalcon_Tag, stylesheetLink) zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool local; zval *parameters = NULL, parameters_sub, *local_param = NULL, __$null, params, code, _10, _11, _0$$3, _1$$5, _2$$7, _3$$8, _4$$10, _5$$11, _6$$12, _7$$12, _8$$12, _9$$13, _12$$14, _13$$14, _14$$15, _15$$15; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_NULL(&__$null); @@ -16814,17 +16120,14 @@ static PHP_METHOD(Phalcon_Tag, stylesheetLink) ZVAL_UNDEF(&_13$$14); ZVAL_UNDEF(&_14$$15); ZVAL_UNDEF(&_15$$15); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(0, 2) Z_PARAM_OPTIONAL Z_PARAM_ZVAL_OR_NULL(parameters) Z_PARAM_BOOL(local) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 0, 2, ¶meters, &local_param); if (!parameters) { parameters = ¶meters_sub; @@ -16833,10 +16136,7 @@ static PHP_METHOD(Phalcon_Tag, stylesheetLink) if (!local_param) { local = 1; } else { - local = zephir_get_boolval(local_param); - } - - + } if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 2, 0); @@ -16848,12 +16148,12 @@ static PHP_METHOD(Phalcon_Tag, stylesheetLink) ZEPHIR_CPY_WRT(¶ms, parameters); } if (zephir_array_isset_long(¶ms, 1)) { - ZEPHIR_OBS_VAR(&_1$$5); + zephir_memory_observe(&_1$$5); zephir_array_fetch_long(&_1$$5, ¶ms, 1, PH_NOISY, "phalcon/Tag.zep", 1127); local = zephir_get_boolval(&_1$$5); } else { if (zephir_array_isset_string(¶ms, SL("local"))) { - ZEPHIR_OBS_VAR(&_2$$7); + zephir_memory_observe(&_2$$7); zephir_array_fetch_string(&_2$$7, ¶ms, SL("local"), PH_NOISY, "phalcon/Tag.zep", 1130); local = zephir_get_boolval(&_2$$7); zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); @@ -16914,23 +16214,16 @@ static PHP_METHOD(Phalcon_Tag, submitButton) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1, _2; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_2); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "submit"); ZVAL_BOOL(&_2, 1); @@ -16946,7 +16239,6 @@ static PHP_METHOD(Phalcon_Tag, tagHtml) zend_bool selfClose, onlyStart, useEol; zval *tagName_param = NULL, *parameters = NULL, parameters_sub, *selfClose_param = NULL, *onlyStart_param = NULL, *useEol_param = NULL, __$null, params, localCode, _1, _3$$11; zval tagName, _0, _2$$10; - zval *this_ptr = getThis(); ZVAL_UNDEF(&tagName); ZVAL_UNDEF(&_0); @@ -16957,7 +16249,6 @@ static PHP_METHOD(Phalcon_Tag, tagHtml) ZVAL_UNDEF(&localCode); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_3$$11); -#if PHP_VERSION_ID >= 80000 bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 5) Z_PARAM_STR(tagName) @@ -16967,10 +16258,8 @@ static PHP_METHOD(Phalcon_Tag, tagHtml) Z_PARAM_BOOL(onlyStart) Z_PARAM_BOOL(useEol) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 4, &tagName_param, ¶meters, &selfClose_param, &onlyStart_param, &useEol_param); zephir_get_strval(&tagName, tagName_param); if (!parameters) { @@ -16980,20 +16269,15 @@ static PHP_METHOD(Phalcon_Tag, tagHtml) if (!selfClose_param) { selfClose = 0; } else { - selfClose = zephir_get_boolval(selfClose_param); - } + } if (!onlyStart_param) { onlyStart = 0; } else { - onlyStart = zephir_get_boolval(onlyStart_param); - } + } if (!useEol_param) { useEol = 0; } else { - useEol = zephir_get_boolval(useEol_param); - } - - + } if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 1, 0); @@ -17035,30 +16319,22 @@ static PHP_METHOD(Phalcon_Tag, tagHtmlClose) zend_bool useEol; zval *tagName_param = NULL, *useEol_param = NULL, _0$$3; zval tagName; - zval *this_ptr = getThis(); ZVAL_UNDEF(&tagName); ZVAL_UNDEF(&_0$$3); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(tagName) Z_PARAM_OPTIONAL Z_PARAM_BOOL(useEol) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 1, &tagName_param, &useEol_param); zephir_get_strval(&tagName, tagName_param); if (!useEol_param) { useEol = 0; } else { - useEol = zephir_get_boolval(useEol_param); - } - - + } if (useEol) { ZEPHIR_INIT_VAR(&_0$$3); ZEPHIR_GET_CONSTANT(&_0$$3, "PHP_EOL"); @@ -17075,22 +16351,15 @@ static PHP_METHOD(Phalcon_Tag, telField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "tel"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -17103,7 +16372,6 @@ static PHP_METHOD(Phalcon_Tag, textArea) zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *parameters, parameters_sub, params, id, name, content, code, _1, _2, _3, _0$$6; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(¶ms); @@ -17115,18 +16383,12 @@ static PHP_METHOD(Phalcon_Tag, textArea) ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_0$$6); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 1, 0); @@ -17140,12 +16402,12 @@ static PHP_METHOD(Phalcon_Tag, textArea) zephir_array_update_long(¶ms, 0, &_0$$6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } } - ZEPHIR_OBS_VAR(&id); + zephir_memory_observe(&id); zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/Tag.zep", 1281); if (!(zephir_array_isset_string(¶ms, SL("name")))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_OBS_VAR(&name); + zephir_memory_observe(&name); zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/Tag.zep", 1286); if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); @@ -17155,7 +16417,7 @@ static PHP_METHOD(Phalcon_Tag, textArea) zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); } if (zephir_array_isset_string(¶ms, SL("value"))) { - ZEPHIR_OBS_VAR(&content); + zephir_memory_observe(&content); zephir_array_fetch_string(&content, ¶ms, SL("value"), PH_NOISY, "phalcon/Tag.zep", 1298); zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); } else { @@ -17170,7 +16432,7 @@ static PHP_METHOD(Phalcon_Tag, textArea) ZVAL_STRING(&_1, "", &_2, ""); @@ -17184,22 +16446,15 @@ static PHP_METHOD(Phalcon_Tag, textField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "text"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -17213,22 +16468,15 @@ static PHP_METHOD(Phalcon_Tag, timeField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "time"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -17242,22 +16490,15 @@ static PHP_METHOD(Phalcon_Tag, urlField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "url"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -17271,22 +16512,15 @@ static PHP_METHOD(Phalcon_Tag, weekField) zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *parameters, parameters_sub, _1; - zval *this_ptr = getThis(); ZVAL_UNDEF(¶meters_sub); ZVAL_UNDEF(&_1); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 1, 0, ¶meters); - - ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "week"); ZEPHIR_RETURN_CALL_SELF("inputfield", &_0, 0, &_1, parameters); @@ -17301,7 +16535,6 @@ static PHP_METHOD(Phalcon_Tag, inputField) zend_bool asValue, _1$$10; zval *type_param = NULL, *parameters, parameters_sub, *asValue_param = NULL, params, id, value, code, name, _3, _4, _0$$6, _2$$5; zval type; - zval *this_ptr = getThis(); ZVAL_UNDEF(&type); ZVAL_UNDEF(¶meters_sub); @@ -17314,27 +16547,20 @@ static PHP_METHOD(Phalcon_Tag, inputField) ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_0$$6); ZVAL_UNDEF(&_2$$5); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_STR(type) Z_PARAM_ZVAL(parameters) Z_PARAM_OPTIONAL Z_PARAM_BOOL(asValue) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 2, 1, &type_param, ¶meters, &asValue_param); zephir_get_strval(&type, type_param); if (!asValue_param) { asValue = 0; } else { - asValue = zephir_get_boolval(asValue_param); - } - - + } ZEPHIR_INIT_VAR(¶ms); array_init(¶ms); if (Z_TYPE_P(parameters) != IS_ARRAY) { @@ -17343,12 +16569,12 @@ static PHP_METHOD(Phalcon_Tag, inputField) ZEPHIR_CPY_WRT(¶ms, parameters); } if (asValue == 0) { - ZEPHIR_OBS_VAR(&id); + zephir_memory_observe(&id); if (!(zephir_array_isset_long_fetch(&id, ¶ms, 0, 0))) { zephir_array_fetch_string(&_0$$6, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1403); zephir_array_update_long(¶ms, 0, &_0$$6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } - ZEPHIR_OBS_VAR(&name); + zephir_memory_observe(&name); if (zephir_array_isset_string_fetch(&name, ¶ms, SL("name"), 0)) { if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); @@ -17370,7 +16596,7 @@ static PHP_METHOD(Phalcon_Tag, inputField) zephir_array_update_string(¶ms, SL("value"), &_2$$5, PH_COPY | PH_SEPARATE); } else { if (!(zephir_array_isset_string(¶ms, SL("value")))) { - ZEPHIR_OBS_VAR(&value); + zephir_memory_observe(&value); if (zephir_array_isset_long_fetch(&value, ¶ms, 0, 0)) { zephir_array_update_string(¶ms, SL("value"), &value, PH_COPY | PH_SEPARATE); } @@ -17397,7 +16623,6 @@ static PHP_METHOD(Phalcon_Tag, inputFieldChecked) zend_long ZEPHIR_LAST_CALL_STATUS; zval *type_param = NULL, *parameters, parameters_sub, params, value, id, code, name, currentValue, _1, _2, _6, _7, _0$$5, _4$$12, _5$$14; zval type; - zval *this_ptr = getThis(); ZVAL_UNDEF(&type); ZVAL_UNDEF(¶meters_sub); @@ -17414,20 +16639,14 @@ static PHP_METHOD(Phalcon_Tag, inputFieldChecked) ZVAL_UNDEF(&_0$$5); ZVAL_UNDEF(&_4$$12); ZVAL_UNDEF(&_5$$14); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; ZEND_PARSE_PARAMETERS_START(2, 2) Z_PARAM_STR(type) Z_PARAM_ZVAL(parameters) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); zephir_fetch_params(1, 2, 0, &type_param, ¶meters); zephir_get_strval(&type, type_param); - - if (Z_TYPE_P(parameters) != IS_ARRAY) { ZEPHIR_INIT_VAR(¶ms); zephir_create_array(¶ms, 1, 0); @@ -17439,12 +16658,12 @@ static PHP_METHOD(Phalcon_Tag, inputFieldChecked) zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag.zep", 1464); zephir_array_update_long(¶ms, 0, &_0$$5, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } - ZEPHIR_OBS_VAR(&id); + zephir_memory_observe(&id); zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/Tag.zep", 1467); if (!(zephir_array_isset_string(¶ms, SL("name")))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_OBS_VAR(&name); + zephir_memory_observe(&name); zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/Tag.zep", 1472); if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); @@ -17459,7 +16678,7 @@ static PHP_METHOD(Phalcon_Tag, inputFieldChecked) zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); } } - ZEPHIR_OBS_VAR(¤tValue); + zephir_memory_observe(¤tValue); if (zephir_array_isset_string_fetch(¤tValue, ¶ms, SL("value"), 0)) { zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); ZEPHIR_CALL_SELF(&value, "getvalue", NULL, 0, &id, ¶ms); @@ -17508,171 +16727,485 @@ static PHP_METHOD(Phalcon_Tag, inputFieldChecked) -ZEPHIR_INIT_CLASS(Phalcon_Html_Attributes) +ZEPHIR_INIT_CLASS(Phalcon_Tag_Exception) { - ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Html, Attributes, phalcon, html_attributes, phalcon_support_collection_ce, phalcon_html_attributes_method_entry, 0); + ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Tag, Exception, phalcon, tag_exception, zend_ce_exception, NULL, 0); - zend_class_implements(phalcon_html_attributes_ce, 1, phalcon_html_attributes_renderinterface_ce); return SUCCESS; } -static PHP_METHOD(Phalcon_Html_Attributes, render) -{ - zval _0; - zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); - ZVAL_UNDEF(&_0); - ZEPHIR_MM_GROW(); +#ifdef HAVE_CONFIG_H +#endif - ZEPHIR_CALL_METHOD(&_0, this_ptr, "toarray", NULL, 0); - zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "renderattributes", NULL, 0, &_0); - zephir_check_call_status(); - RETURN_MM(); + + + + +ZEPHIR_INIT_CLASS(Phalcon_Tag_Select) +{ + ZEPHIR_REGISTER_CLASS(Phalcon\\Tag, Select, phalcon, tag_select, phalcon_tag_select_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + + return SUCCESS; } -static PHP_METHOD(Phalcon_Html_Attributes, __toString) +static PHP_METHOD(Phalcon_Tag_Select, selectField) { + zend_bool _1$$19; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *this_ptr = getThis(); + zval *parameters, parameters_sub, *data = NULL, data_sub, __$null, params, name, id, value, useEmpty, code, emptyValue, emptyText, options, using, _2, _3, _0$$5, _4$$22, _5$$22, _6$$23, _8$$23, _9$$23, _10$$25, _12$$25, _13$$25; - - - ZEPHIR_MM_GROW(); - - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "render", NULL, 0); + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&useEmpty); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&emptyValue); + ZVAL_UNDEF(&emptyText); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&using); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_4$$22); + ZVAL_UNDEF(&_5$$22); + ZVAL_UNDEF(&_6$$23); + ZVAL_UNDEF(&_8$$23); + ZVAL_UNDEF(&_9$$23); + ZVAL_UNDEF(&_10$$25); + ZVAL_UNDEF(&_12$$25); + ZVAL_UNDEF(&_13$$25); + bool is_null_true = 1; + ZEND_PARSE_PARAMETERS_START(1, 2) + Z_PARAM_ZVAL(parameters) + Z_PARAM_OPTIONAL + Z_PARAM_ZVAL_OR_NULL(data) + ZEND_PARSE_PARAMETERS_END(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + zephir_fetch_params(1, 1, 1, ¶meters, &data); + if (!data) { + data = &data_sub; + data = &__$null; + } + if (Z_TYPE_P(parameters) != IS_ARRAY) { + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 2, 0); + zephir_array_fast_append(¶ms, parameters); + zephir_array_fast_append(¶ms, data); + } else { + ZEPHIR_CPY_WRT(¶ms, parameters); + } + zephir_memory_observe(&id); + if (!(zephir_array_isset_long_fetch(&id, ¶ms, 0, 0))) { + zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/Tag/Select.zep", 50); + zephir_array_update_long(¶ms, 0, &_0$$5, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + } + if (!(zephir_memnstr_str(&id, SL("["), "phalcon/Tag/Select.zep", 56))) { + if (!(zephir_array_isset_string(¶ms, SL("id")))) { + zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); + } + } + zephir_memory_observe(&name); + if (!(zephir_array_isset_string_fetch(&name, ¶ms, SL("name"), 0))) { + zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); + } else { + if (!(zephir_is_true(&name))) { + zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); + } + } + zephir_memory_observe(&value); + if (!(zephir_array_isset_string_fetch(&value, ¶ms, SL("value"), 0))) { + ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", NULL, 0, &id, ¶ms); + zephir_check_call_status(); + } else { + zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); + } + zephir_memory_observe(&useEmpty); + if (zephir_array_isset_string_fetch(&useEmpty, ¶ms, SL("useEmpty"), 0)) { + zephir_memory_observe(&emptyValue); + if (!(zephir_array_isset_string_fetch(&emptyValue, ¶ms, SL("emptyValue"), 0))) { + ZEPHIR_INIT_NVAR(&emptyValue); + ZVAL_STRING(&emptyValue, ""); + } else { + zephir_array_unset_string(¶ms, SL("emptyValue"), PH_SEPARATE); + } + zephir_memory_observe(&emptyText); + if (!(zephir_array_isset_string_fetch(&emptyText, ¶ms, SL("emptyText"), 0))) { + ZEPHIR_INIT_NVAR(&emptyText); + ZVAL_STRING(&emptyText, "Choose..."); + } else { + zephir_array_unset_string(¶ms, SL("emptyText"), PH_SEPARATE); + } + zephir_array_unset_string(¶ms, SL("useEmpty"), PH_SEPARATE); + } + zephir_memory_observe(&options); + if (!(zephir_array_isset_long_fetch(&options, ¶ms, 1, 0))) { + ZEPHIR_CPY_WRT(&options, data); + } + if (Z_TYPE_P(&options) == IS_OBJECT) { + zephir_memory_observe(&using); + if (UNEXPECTED(!(zephir_array_isset_string_fetch(&using, ¶ms, SL("using"), 0)))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter is required", "phalcon/Tag/Select.zep", 101); + return; + } + _1$$19 = Z_TYPE_P(&using) != IS_ARRAY; + if (_1$$19) { + _1$$19 = Z_TYPE_P(&using) != IS_OBJECT; + } + if (UNEXPECTED(_1$$19)) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter should be an array", "phalcon/Tag/Select.zep", 107); + return; + } + } + zephir_array_unset_string(¶ms, SL("using"), PH_SEPARATE); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "", &_3); + if (zephir_is_true(&useEmpty)) { + ZEPHIR_INIT_VAR(&_4$$22); + ZEPHIR_GET_CONSTANT(&_4$$22, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_5$$22); + ZEPHIR_CONCAT_SVSVSV(&_5$$22, "\t", &_4$$22); + zephir_concat_self(&code, &_5$$22); + } + if (Z_TYPE_P(&options) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_8$$23); + ZEPHIR_GET_CONSTANT(&_8$$23, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_9$$23); + ZEPHIR_CONCAT_SV(&_9$$23, "", &_8$$23); + ZEPHIR_CALL_SELF(&_6$$23, "optionsfromresultset", &_7, 0, &options, &using, &value, &_9$$23); + zephir_check_call_status(); + zephir_concat_self(&code, &_6$$23); + } else { + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_12$$25); + ZEPHIR_GET_CONSTANT(&_12$$25, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_13$$25); + ZEPHIR_CONCAT_SV(&_13$$25, "", &_12$$25); + ZEPHIR_CALL_SELF(&_10$$25, "optionsfromarray", &_11, 0, &options, &value, &_13$$25); + zephir_check_call_status(); + zephir_concat_self(&code, &_10$$25); + } + } + zephir_concat_self_str(&code, SL("")); + RETURN_CCTOR(&code); } -static PHP_METHOD(Phalcon_Html_Attributes, renderAttributes) +static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) { - zend_bool _4$$3, _10$$5; zend_string *_3; zend_ulong _2; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_8 = NULL; + zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes_param = NULL, __$null, __$true, intersect, key, result, results, value, *_0, _1, _5$$4, _6$$4, _7$$4, _9$$4, _11$$6, _12$$6, _13$$6, _14$$6; - zval attributes, order; - zval *this_ptr = getThis(); + zval closeOption, _12$$8, _13$$8, _22$$16, _23$$16; + zval *data_param = NULL, *value, value_sub, *closeOption_param = NULL, strValue, strOptionValue, code, optionValue, optionText, escaped, *_0, _1, _5$$4, _6$$4, _8$$4, _9$$4, _10$$6, _11$$7, _14$$9, _15$$10, _16$$12, _17$$12, _18$$12, _19$$12, _20$$14, _21$$15, _24$$17, _25$$18; + zval data; - ZVAL_UNDEF(&attributes); - ZVAL_UNDEF(&order); - ZVAL_NULL(&__$null); - ZVAL_BOOL(&__$true, 1); - ZVAL_UNDEF(&intersect); - ZVAL_UNDEF(&key); - ZVAL_UNDEF(&result); - ZVAL_UNDEF(&results); - ZVAL_UNDEF(&value); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&strValue); + ZVAL_UNDEF(&strOptionValue); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&optionValue); + ZVAL_UNDEF(&optionText); + ZVAL_UNDEF(&escaped); ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_5$$4); ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); ZVAL_UNDEF(&_9$$4); - ZVAL_UNDEF(&_11$$6); - ZVAL_UNDEF(&_12$$6); - ZVAL_UNDEF(&_13$$6); - ZVAL_UNDEF(&_14$$6); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(1, 1) - Z_PARAM_ARRAY(attributes) + ZVAL_UNDEF(&_10$$6); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_15$$10); + ZVAL_UNDEF(&_16$$12); + ZVAL_UNDEF(&_17$$12); + ZVAL_UNDEF(&_18$$12); + ZVAL_UNDEF(&_19$$12); + ZVAL_UNDEF(&_20$$14); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_24$$17); + ZVAL_UNDEF(&_25$$18); + ZVAL_UNDEF(&closeOption); + ZVAL_UNDEF(&_12$$8); + ZVAL_UNDEF(&_13$$8); + ZVAL_UNDEF(&_22$$16); + ZVAL_UNDEF(&_23$$16); + ZEND_PARSE_PARAMETERS_START(3, 3) + Z_PARAM_ARRAY(data) + Z_PARAM_ZVAL(value) + Z_PARAM_STR(closeOption) ZEND_PARSE_PARAMETERS_END(); -#endif - - - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 1, 0, &attributes_param); - zephir_get_arrval(&attributes, attributes_param); - - - ZEPHIR_INIT_VAR(&order); - zephir_create_array(&order, 10, 0); - zephir_array_update_string(&order, SL("rel"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("type"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("for"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("src"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("href"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("action"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("id"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("name"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("value"), &__$null, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("class"), &__$null, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&intersect, "array_intersect_key", NULL, 2, &order, &attributes); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(&results); - zephir_fast_array_merge(&results, &intersect, &attributes); - zephir_array_unset_string(&results, SL("escape"), PH_SEPARATE); - ZEPHIR_INIT_VAR(&result); - ZVAL_STRING(&result, ""); - zephir_is_iterable(&results, 0, "phalcon/Html/Attributes.zep", 76); - if (Z_TYPE_P(&results) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&results), _2, _3, _0) + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + zephir_fetch_params(1, 3, 0, &data_param, &value, &closeOption_param); + zephir_get_arrval(&data, data_param); + zephir_get_strval(&closeOption, closeOption_param); + ZEPHIR_INIT_VAR(&code); + ZVAL_STRING(&code, ""); + zephir_is_iterable(&data, 0, "phalcon/Tag/Select.zep", 186); + if (Z_TYPE_P(&data) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0) { - ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_NVAR(&optionValue); if (_3 != NULL) { - ZVAL_STR_COPY(&key, _3); + ZVAL_STR_COPY(&optionValue, _3); } else { - ZVAL_LONG(&key, _2); - } - ZEPHIR_INIT_NVAR(&value); - ZVAL_COPY(&value, _0); - _4$$3 = Z_TYPE_P(&key) == IS_STRING; - if (_4$$3) { - _4$$3 = Z_TYPE_P(&value) != IS_NULL; + ZVAL_LONG(&optionValue, _2); } - if (_4$$3) { - ZVAL_LONG(&_5$$4, 3); - ZEPHIR_INIT_NVAR(&_6$$4); - ZVAL_STRING(&_6$$4, "utf-8"); - ZEPHIR_CALL_FUNCTION(&_7$$4, "htmlspecialchars", &_8, 285, &value, &_5$$4, &_6$$4, &__$true); + ZEPHIR_INIT_NVAR(&optionText); + ZVAL_COPY(&optionText, _0); + ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 286, &optionValue); + zephir_check_call_status(); + if (Z_TYPE_P(&optionText) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_5$$4); + ZEPHIR_GET_CONSTANT(&_5$$4, "PHP_EOL"); + ZEPHIR_CALL_SELF(&_6$$4, "optionsfromarray", &_7, 0, &optionText, value, &closeOption); zephir_check_call_status(); + ZEPHIR_INIT_NVAR(&_8$$4); + ZEPHIR_GET_CONSTANT(&_8$$4, "PHP_EOL"); ZEPHIR_INIT_NVAR(&_9$$4); - ZEPHIR_CONCAT_VSVS(&_9$$4, &key, "=\"", &_7$$4, "\" "); - zephir_concat_self(&result, &_9$$4); + ZEPHIR_CONCAT_SVSVVSV(&_9$$4, "\t", &_5$$4, &_6$$4, "\t", &_8$$4); + zephir_concat_self(&code, &_9$$4); + continue; + } + if (Z_TYPE_P(value) == IS_ARRAY) { + if (zephir_fast_in_array(&optionValue, value)) { + ZEPHIR_INIT_NVAR(&_10$$6); + ZEPHIR_CONCAT_SVSVV(&_10$$6, "\t", &_16$$12, &_17$$12, "\t", &_18$$12); + zephir_concat_self(&code, &_19$$12); + continue; } - if (_10$$5) { - ZVAL_LONG(&_11$$6, 3); - ZEPHIR_INIT_NVAR(&_12$$6); - ZVAL_STRING(&_12$$6, "utf-8"); - ZEPHIR_CALL_FUNCTION(&_13$$6, "htmlspecialchars", &_8, 285, &value, &_11$$6, &_12$$6, &__$true); + if (Z_TYPE_P(value) == IS_ARRAY) { + if (zephir_fast_in_array(&optionValue, value)) { + ZEPHIR_INIT_NVAR(&_20$$14); + ZEPHIR_CONCAT_SVSVV(&_20$$14, "\t", &_10$$23); - ZEPHIR_CALL_SELF(&_8$$23, "optionsfromresultset", &_9, 0, &options, &using, &value, &_11$$23); - zephir_check_call_status(); - zephir_concat_self(&code, &_8$$23); - } else { - if (Z_TYPE_P(&options) == IS_ARRAY) { - ZEPHIR_INIT_VAR(&_14$$25); - ZEPHIR_GET_CONSTANT(&_14$$25, "PHP_EOL"); - ZEPHIR_INIT_VAR(&_15$$25); - ZEPHIR_CONCAT_SV(&_15$$25, "", &_14$$25); - ZEPHIR_CALL_SELF(&_12$$25, "optionsfromarray", &_13, 0, &options, &value, &_15$$25); + if (Z_TYPE_P(¶msCache) == IS_ARRAY) { + zephir_is_iterable(¶msCache, 0, "phalcon/Mvc/Model/Binder.zep", 90); + if (Z_TYPE_P(¶msCache) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶msCache), _5$$4, _6$$4, _3$$4) + { + ZEPHIR_INIT_NVAR(¶mKey); + if (_6$$4 != NULL) { + ZVAL_STR_COPY(¶mKey, _6$$4); + } else { + ZVAL_LONG(¶mKey, _5$$4); + } + ZEPHIR_INIT_NVAR(&className); + ZVAL_COPY(&className, _3$$4); + ZEPHIR_OBS_NVAR(¶mValue); + zephir_array_fetch(¶mValue, ¶ms, ¶mKey, PH_NOISY, "phalcon/Mvc/Model/Binder.zep", 83); + ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_7, 0, ¶mValue, &className); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("originalValues"), ¶mKey, ¶mValue); + zephir_array_update_zval(¶ms, ¶mKey, &boundModel, PH_COPY | PH_SEPARATE); + zephir_update_property_array(this_ptr, SL("boundModels"), ¶mKey, &boundModel); + } ZEND_HASH_FOREACH_END(); + } else { + ZEPHIR_CALL_METHOD(NULL, ¶msCache, "rewind", NULL, 0); zephir_check_call_status(); - zephir_concat_self(&code, &_12$$25); + while (1) { + ZEPHIR_CALL_METHOD(&_4$$4, ¶msCache, "valid", NULL, 0); + zephir_check_call_status(); + if (!zend_is_true(&_4$$4)) { + break; + } + ZEPHIR_CALL_METHOD(¶mKey, ¶msCache, "key", NULL, 0); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&className, ¶msCache, "current", NULL, 0); + zephir_check_call_status(); + ZEPHIR_OBS_NVAR(¶mValue); + zephir_array_fetch(¶mValue, ¶ms, ¶mKey, PH_NOISY, "phalcon/Mvc/Model/Binder.zep", 83); + ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_7, 0, ¶mValue, &className); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("originalValues"), ¶mKey, ¶mValue); + zephir_array_update_zval(¶ms, ¶mKey, &boundModel, PH_COPY | PH_SEPARATE); + zephir_update_property_array(this_ptr, SL("boundModels"), ¶mKey, &boundModel); + ZEPHIR_CALL_METHOD(NULL, ¶msCache, "next", NULL, 0); + zephir_check_call_status(); + } } + ZEPHIR_INIT_NVAR(&className); + ZEPHIR_INIT_NVAR(¶mKey); + RETURN_CTOR(¶ms); } - zephir_concat_self_str(&code, SL("")); - RETURN_CCTOR(&code); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getparamsfromreflection", NULL, 0, handler, ¶ms, &cacheKey, &methodName); + zephir_check_call_status(); + RETURN_MM(); } -static PHP_METHOD(Phalcon_Tag_Select, optionsFromArray) +static PHP_METHOD(Phalcon_Mvc_Model_Binder, findBoundModel) { - zend_string *_3; - zend_ulong _2; + zend_class_entry *_0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval closeOption, _12$$8, _13$$8, _22$$16, _23$$16; - zval *data_param = NULL, *value, value_sub, *closeOption_param = NULL, strValue, strOptionValue, code, optionValue, optionText, escaped, *_0, _1, _5$$4, _6$$4, _8$$4, _9$$4, _10$$6, _11$$7, _14$$9, _15$$10, _16$$12, _17$$12, _18$$12, _19$$12, _20$$14, _21$$15, _24$$17, _25$$18; - zval data; - zval *this_ptr = getThis(); + zval className; + zval *paramValue, paramValue_sub, *className_param = NULL; - ZVAL_UNDEF(&data); - ZVAL_UNDEF(&value_sub); - ZVAL_UNDEF(&strValue); - ZVAL_UNDEF(&strOptionValue); - ZVAL_UNDEF(&code); - ZVAL_UNDEF(&optionValue); - ZVAL_UNDEF(&optionText); - ZVAL_UNDEF(&escaped); - ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_5$$4); - ZVAL_UNDEF(&_6$$4); - ZVAL_UNDEF(&_8$$4); - ZVAL_UNDEF(&_9$$4); - ZVAL_UNDEF(&_10$$6); - ZVAL_UNDEF(&_11$$7); - ZVAL_UNDEF(&_14$$9); - ZVAL_UNDEF(&_15$$10); - ZVAL_UNDEF(&_16$$12); - ZVAL_UNDEF(&_17$$12); - ZVAL_UNDEF(&_18$$12); - ZVAL_UNDEF(&_19$$12); - ZVAL_UNDEF(&_20$$14); - ZVAL_UNDEF(&_21$$15); - ZVAL_UNDEF(&_24$$17); - ZVAL_UNDEF(&_25$$18); - ZVAL_UNDEF(&closeOption); - ZVAL_UNDEF(&_12$$8); - ZVAL_UNDEF(&_13$$8); - ZVAL_UNDEF(&_22$$16); - ZVAL_UNDEF(&_23$$16); -#if PHP_VERSION_ID >= 80000 - bool is_null_true = 1; - ZEND_PARSE_PARAMETERS_START(3, 3) - Z_PARAM_ARRAY(data) - Z_PARAM_ZVAL(value) - Z_PARAM_STR(closeOption) + ZVAL_UNDEF(¶mValue_sub); + ZVAL_UNDEF(&className); + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_ZVAL(paramValue) + Z_PARAM_STR(className) ZEND_PARSE_PARAMETERS_END(); -#endif + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + zephir_fetch_params(1, 2, 0, ¶mValue, &className_param); + zephir_get_strval(&className, className_param); + _0 = zephir_fetch_class(&className); + ZEPHIR_RETURN_CALL_CE_STATIC(_0, "findfirst", NULL, 0, paramValue); + zephir_check_call_status(); + RETURN_MM(); +} +static PHP_METHOD(Phalcon_Mvc_Model_Binder, getBoundModels) +{ - ZEPHIR_MM_GROW(); - zephir_fetch_params(1, 3, 0, &data_param, &value, &closeOption_param); - zephir_get_arrval(&data, data_param); - zephir_get_strval(&closeOption, closeOption_param); + RETURN_MEMBER(getThis(), "boundModels"); +} +static PHP_METHOD(Phalcon_Mvc_Model_Binder, getOriginalValues) +{ - ZEPHIR_INIT_VAR(&code); - ZVAL_STRING(&code, ""); - zephir_is_iterable(&data, 0, "phalcon/Tag/Select.zep", 186); - if (Z_TYPE_P(&data) == IS_ARRAY) { - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _0) + RETURN_MEMBER(getThis(), "originalValues"); +} + +static PHP_METHOD(Phalcon_Mvc_Model_Binder, getCache) +{ + + RETURN_MEMBER(getThis(), "cache"); +} + +static PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromCache) +{ + zend_bool _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval *cacheKey_param = NULL, cache, internalParams, _0, _1, _3; + zval cacheKey; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cacheKey); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&internalParams); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_STR(cacheKey) + ZEND_PARSE_PARAMETERS_END(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + zephir_fetch_params(1, 1, 0, &cacheKey_param); + zephir_get_strval(&cacheKey, cacheKey_param); + zephir_memory_observe(&internalParams); + zephir_read_property(&_0, this_ptr, ZEND_STRL("internalCache"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&internalParams, &_0, &cacheKey, 0)) { + RETURN_CCTOR(&internalParams); + } + zephir_read_property(&_1, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&cache, &_1); + _2 = Z_TYPE_P(&cache) == IS_NULL; + if (!(_2)) { + ZEPHIR_CALL_METHOD(&_3, &cache, "has", NULL, 0, &cacheKey); + zephir_check_call_status(); + _2 = !zephir_is_true(&_3); + } + if (_2) { + RETURN_MM_NULL(); + } + ZEPHIR_CALL_METHOD(&internalParams, &cache, "get", NULL, 0, &cacheKey); + zephir_check_call_status(); + zephir_update_property_array(this_ptr, SL("internalCache"), &cacheKey, &internalParams); + RETURN_CCTOR(&internalParams); +} + +static PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) +{ + zend_class_entry *_9$$10, *_17$$24; + zend_string *_4; + zend_ulong _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zephir_fcall_cache_entry *_8 = NULL, *_12 = NULL, *_13 = NULL; + zend_long ZEPHIR_LAST_CALL_STATUS; + zval cacheKey, methodName; + zval params, paramsCache; + zval *handler, handler_sub, *params_param = NULL, *cacheKey_param = NULL, *methodName_param = NULL, methodParams, reflection, paramKey, methodParam, className, realClasses, boundModel, cache, handlerClass, reflectionClass, paramsKeys, paramValue, _0, *_1, _2, _5$$7, _6$$5, _7$$5, _10$$14, _11$$14, _14$$21, _15$$19, _16$$19, _18$$28, _19$$28; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&methodParams); + ZVAL_UNDEF(&reflection); + ZVAL_UNDEF(¶mKey); + ZVAL_UNDEF(&methodParam); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&realClasses); + ZVAL_UNDEF(&boundModel); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&handlerClass); + ZVAL_UNDEF(&reflectionClass); + ZVAL_UNDEF(¶msKeys); + ZVAL_UNDEF(¶mValue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_10$$14); + ZVAL_UNDEF(&_11$$14); + ZVAL_UNDEF(&_14$$21); + ZVAL_UNDEF(&_15$$19); + ZVAL_UNDEF(&_16$$19); + ZVAL_UNDEF(&_18$$28); + ZVAL_UNDEF(&_19$$28); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(¶msCache); + ZVAL_UNDEF(&cacheKey); + ZVAL_UNDEF(&methodName); + ZEND_PARSE_PARAMETERS_START(4, 4) + Z_PARAM_OBJECT(handler) + Z_PARAM_ARRAY(params) + Z_PARAM_STR(cacheKey) + Z_PARAM_STR(methodName) + ZEND_PARSE_PARAMETERS_END(); + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 0); + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + zephir_fetch_params(1, 4, 0, &handler, ¶ms_param, &cacheKey_param, &methodName_param); + zephir_get_arrval(¶ms, params_param); + zephir_get_strval(&cacheKey, cacheKey_param); + if (UNEXPECTED(Z_TYPE_P(methodName_param) != IS_STRING && Z_TYPE_P(methodName_param) != IS_NULL)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'methodName' must be of the type string")); + RETURN_MM_NULL(); + } + if (EXPECTED(Z_TYPE_P(methodName_param) == IS_STRING)) { + zephir_get_strval(&methodName, methodName_param); + } else { + ZEPHIR_INIT_VAR(&methodName); + } + ZEPHIR_INIT_VAR(&realClasses); + ZVAL_NULL(&realClasses); + ZEPHIR_INIT_VAR(¶msCache); + array_init(¶msCache); + ZEPHIR_INIT_VAR(&reflection); + if (!ZEPHIR_IS_NULL(&methodName)) { + object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionmethod"))); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 437, handler, &methodName); + zephir_check_call_status(); + } else { + object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionfunction"))); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 151, handler); + zephir_check_call_status(); + } + zephir_read_property(&_0, this_ptr, ZEND_STRL("cache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&cache, &_0); + ZEPHIR_CALL_METHOD(&methodParams, &reflection, "getparameters", NULL, 152); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(¶msKeys); + zephir_array_keys(¶msKeys, ¶ms); + zephir_is_iterable(&methodParams, 0, "phalcon/Mvc/Model/Binder.zep", 243); + if (Z_TYPE_P(&methodParams) == IS_ARRAY) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodParams), _3, _4, _1) { - ZEPHIR_INIT_NVAR(&optionValue); - if (_3 != NULL) { - ZVAL_STR_COPY(&optionValue, _3); + ZEPHIR_INIT_NVAR(¶mKey); + if (_4 != NULL) { + ZVAL_STR_COPY(¶mKey, _4); } else { - ZVAL_LONG(&optionValue, _2); + ZVAL_LONG(¶mKey, _3); } - ZEPHIR_INIT_NVAR(&optionText); - ZVAL_COPY(&optionText, _0); - ZEPHIR_CALL_FUNCTION(&escaped, "htmlspecialchars", &_4, 285, &optionValue); + ZEPHIR_INIT_NVAR(&methodParam); + ZVAL_COPY(&methodParam, _1); + ZEPHIR_CALL_METHOD(&reflectionClass, &methodParam, "getclass", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(&optionText) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(&_5$$4); - ZEPHIR_GET_CONSTANT(&_5$$4, "PHP_EOL"); - ZEPHIR_CALL_SELF(&_6$$4, "optionsfromarray", &_7, 0, &optionText, value, &closeOption); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(&_8$$4); - ZEPHIR_GET_CONSTANT(&_8$$4, "PHP_EOL"); - ZEPHIR_INIT_NVAR(&_9$$4); - ZEPHIR_CONCAT_SVSVVSV(&_9$$4, "\t", &_5$$4, &_6$$4, "\t", &_8$$4); - zephir_concat_self(&code, &_9$$4); + if (!(zephir_is_true(&reflectionClass))) { continue; } - if (Z_TYPE_P(value) == IS_ARRAY) { - if (zephir_fast_in_array(&optionValue, value)) { - ZEPHIR_INIT_NVAR(&_10$$6); - ZEPHIR_CONCAT_SVSVV(&_10$$6, "\t", &_16$$12, &_17$$12, "\t", &_18$$12); - zephir_concat_self(&code, &_19$$12); + if (!(zephir_is_true(&reflectionClass))) { continue; } - if (Z_TYPE_P(value) == IS_ARRAY) { - if (zephir_fast_in_array(&optionValue, value)) { - ZEPHIR_INIT_NVAR(&_20$$14); - ZEPHIR_CONCAT_SVSVV(&_20$$14, "\t