Use ZEND_THIS macro to hide implementation details in extensions code.

This commit is contained in:
Dmitry Stogov 2018-11-15 19:54:19 +03:00
parent 8f2f80668e
commit 0f7f1498be
54 changed files with 688 additions and 687 deletions

View File

@ -357,7 +357,9 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *na
ZEND_API char *zend_get_type_by_const(int type);
#define getThis() ((Z_TYPE(EX(This)) == IS_OBJECT) ? &EX(This) : NULL)
#define ZEND_THIS (&EX(This))
#define getThis() ((Z_TYPE_P(ZEND_THIS) == IS_OBJECT) ? ZEND_THIS : NULL)
#define ZEND_IS_METHOD_CALL() (EX(func)->common.scope != NULL)
#define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT()

View File

@ -49,7 +49,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
zend_function *func = EX(func);
zval *arguments = ZEND_CALL_ARG(execute_data, 1);
if (call_user_function(CG(function_table), NULL, &EX(This), return_value, ZEND_NUM_ARGS(), arguments) == FAILURE) {
if (call_user_function(CG(function_table), NULL, ZEND_THIS, return_value, ZEND_NUM_ARGS(), arguments) == FAILURE) {
RETVAL_FALSE;
}
@ -126,7 +126,7 @@ ZEND_METHOD(Closure, call)
return;
}
closure = (zend_closure *) Z_OBJ(EX(This));
closure = (zend_closure *) Z_OBJ_P(ZEND_THIS);
newobj = Z_OBJ_P(newthis);
@ -257,8 +257,7 @@ static ZEND_NAMED_FUNCTION(zend_closure_call_magic) /* {{{ */ {
ZVAL_EMPTY_ARRAY(&fci.params[1]);
}
fci.object = Z_OBJ(EX(This));
fcc.object = Z_OBJ(EX(This));
fcc.object = fci.object = Z_OBJ_P(ZEND_THIS);
zend_call_function(&fci, &fcc);

View File

@ -270,7 +270,7 @@ ZEND_METHOD(exception, __construct)
zend_class_entry *base_ce;
int argc = ZEND_NUM_ARGS();
object = &EX(This);
object = ZEND_THIS;
base_ce = i_get_exception_base(object);
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|SlO!", &message, &code, &previous, zend_ce_throwable) == FAILURE) {
@ -314,7 +314,7 @@ ZEND_METHOD(exception, __construct)
ZEND_METHOD(exception, __wakeup)
{
zval value, *pvalue;
zval *object = &EX(This);
zval *object = ZEND_THIS;
CHECK_EXC_TYPE(ZEND_STR_MESSAGE, IS_STRING);
CHECK_EXC_TYPE(ZEND_STR_STRING, IS_STRING);
CHECK_EXC_TYPE(ZEND_STR_CODE, IS_LONG);
@ -353,7 +353,7 @@ ZEND_METHOD(error_exception, __construct)
return;
}
object = &EX(This);
object = ZEND_THIS;
if (message) {
ZVAL_STR_COPY(&tmp, message);
@ -404,7 +404,7 @@ ZEND_METHOD(exception, getFile)
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_FILE));
ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_FILE));
}
/* }}} */
@ -416,7 +416,7 @@ ZEND_METHOD(exception, getLine)
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_LINE));
ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_LINE));
}
/* }}} */
@ -428,7 +428,7 @@ ZEND_METHOD(exception, getMessage)
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_MESSAGE));
ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_MESSAGE));
}
/* }}} */
@ -440,7 +440,7 @@ ZEND_METHOD(exception, getCode)
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_CODE));
ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_CODE));
}
/* }}} */
@ -452,7 +452,7 @@ ZEND_METHOD(exception, getTrace)
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_TRACE));
ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_TRACE));
}
/* }}} */
@ -464,7 +464,7 @@ ZEND_METHOD(error_exception, getSeverity)
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY(&EX(This), ZEND_STR_SEVERITY));
ZVAL_COPY(return_value, GET_PROPERTY(ZEND_THIS, ZEND_STR_SEVERITY));
}
/* }}} */
@ -610,7 +610,7 @@ ZEND_METHOD(exception, getTraceAsString)
DEFAULT_0_PARAMS;
object = &EX(This);
object = ZEND_THIS;
base_ce = i_get_exception_base(object);
trace = zend_read_property_ex(base_ce, object, ZSTR_KNOWN(ZEND_STR_TRACE), 1, &rv);
@ -643,7 +643,7 @@ ZEND_METHOD(exception, getPrevious)
DEFAULT_0_PARAMS;
ZVAL_COPY(return_value, GET_PROPERTY_SILENT(&EX(This), ZEND_STR_PREVIOUS));
ZVAL_COPY(return_value, GET_PROPERTY_SILENT(ZEND_THIS, ZEND_STR_PREVIOUS));
} /* }}} */
/* {{{ proto string Exception|Error::__toString()
@ -661,7 +661,7 @@ ZEND_METHOD(exception, __toString)
str = ZSTR_EMPTY_ALLOC();
exception = &EX(This);
exception = ZEND_THIS;
fname = zend_string_init("gettraceasstring", sizeof("gettraceasstring")-1, 0);
while (exception && Z_TYPE_P(exception) == IS_OBJECT && instanceof_function(Z_OBJCE_P(exception), zend_ce_throwable)) {
@ -718,7 +718,7 @@ ZEND_METHOD(exception, __toString)
}
zend_string_release_ex(fname, 0);
exception = &EX(This);
exception = ZEND_THIS;
/* Reset apply counts */
while (exception && Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(exception)) && instanceof_function(Z_OBJCE_P(exception), base_ce)) {
if (Z_IS_RECURSIVE_P(exception)) {
@ -729,7 +729,7 @@ ZEND_METHOD(exception, __toString)
exception = GET_PROPERTY(exception, ZEND_STR_PREVIOUS);
}
exception = &EX(This);
exception = ZEND_THIS;
base_ce = i_get_exception_base(exception);
/* We store the result in the private property string so we can access

View File

@ -877,7 +877,7 @@ ZEND_METHOD(Generator, rewind)
return;
}
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_rewind(generator);
}
@ -893,7 +893,7 @@ ZEND_METHOD(Generator, valid)
return;
}
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_ensure_initialized(generator);
@ -913,7 +913,7 @@ ZEND_METHOD(Generator, current)
return;
}
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_ensure_initialized(generator);
@ -936,7 +936,7 @@ ZEND_METHOD(Generator, key)
return;
}
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_ensure_initialized(generator);
@ -959,7 +959,7 @@ ZEND_METHOD(Generator, next)
return;
}
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_ensure_initialized(generator);
@ -978,7 +978,7 @@ ZEND_METHOD(Generator, send)
Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_ensure_initialized(generator);
@ -1017,7 +1017,7 @@ ZEND_METHOD(Generator, throw)
Z_TRY_ADDREF_P(exception);
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_ensure_initialized(generator);
@ -1052,7 +1052,7 @@ ZEND_METHOD(Generator, getReturn)
return;
}
generator = (zend_generator *) Z_OBJ(EX(This));
generator = (zend_generator *) Z_OBJ_P(ZEND_THIS);
zend_generator_ensure_initialized(generator);
if (UNEXPECTED(EG(exception))) {

View File

@ -54,7 +54,7 @@ static void curlfile_ctor(INTERNAL_FUNCTION_PARAMETERS)
Create the CURLFile object */
ZEND_METHOD(CURLFile, __construct)
{
return_value = &EX(This);
return_value = ZEND_THIS;
curlfile_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
@ -75,7 +75,7 @@ static void curlfile_get_property(char *name, size_t name_len, INTERNAL_FUNCTION
if (zend_parse_parameters_none() == FAILURE) {
return;
}
res = zend_read_property(curl_CURLFile_class, &EX(This), name, name_len, 1, &rv);
res = zend_read_property(curl_CURLFile_class, ZEND_THIS, name, name_len, 1, &rv);
ZVAL_COPY_DEREF(return_value, res);
}
@ -87,7 +87,7 @@ static void curlfile_set_property(char *name, size_t name_len, INTERNAL_FUNCTION
Z_PARAM_STR(arg)
ZEND_PARSE_PARAMETERS_END();
zend_update_property_string(curl_CURLFile_class, &EX(This), name, name_len, ZSTR_VAL(arg));
zend_update_property_string(curl_CURLFile_class, ZEND_THIS, name, name_len, ZSTR_VAL(arg));
}
/* {{{ proto string CURLFile::getFilename()
@ -134,8 +134,8 @@ ZEND_METHOD(CURLFile, setPostFilename)
Unserialization handler */
ZEND_METHOD(CURLFile, __wakeup)
{
zend_unset_property(curl_CURLFile_class, &EX(This), "name", sizeof("name")-1);
zend_update_property_string(curl_CURLFile_class, &EX(This), "name", sizeof("name")-1, "");
zend_unset_property(curl_CURLFile_class, ZEND_THIS, "name", sizeof("name")-1);
zend_update_property_string(curl_CURLFile_class, ZEND_THIS, "name", sizeof("name")-1, "");
zend_throw_exception(NULL, "Unserialization of CURLFile instances is not allowed", 0);
}
/* }}} */

View File

@ -2826,7 +2826,7 @@ PHP_METHOD(DateTime, __construct)
ZEND_PARSE_PARAMETERS_END();
zend_replace_error_handling(EH_THROW, NULL, &error_handling);
php_date_initialize(Z_PHPDATE_P(&EX(This)), time_str, time_str_len, NULL, timezone_object, 1);
php_date_initialize(Z_PHPDATE_P(ZEND_THIS), time_str, time_str_len, NULL, timezone_object, 1);
zend_restore_error_handling(&error_handling);
}
/* }}} */
@ -2848,7 +2848,7 @@ PHP_METHOD(DateTimeImmutable, __construct)
ZEND_PARSE_PARAMETERS_END();
zend_replace_error_handling(EH_THROW, NULL, &error_handling);
php_date_initialize(Z_PHPDATE_P(&EX(This)), time_str, time_str_len, NULL, timezone_object, 1);
php_date_initialize(Z_PHPDATE_P(ZEND_THIS), time_str, time_str_len, NULL, timezone_object, 1);
zend_restore_error_handling(&error_handling);
}
/* }}} */
@ -2992,7 +2992,7 @@ PHP_METHOD(DateTimeImmutable, __set_state)
*/
PHP_METHOD(DateTime, __wakeup)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
php_date_obj *dateobj;
HashTable *myht;
@ -3269,7 +3269,7 @@ PHP_METHOD(DateTimeImmutable, modify)
char *modify;
size_t modify_len;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &modify, &modify_len) == FAILURE) {
RETURN_FALSE;
}
@ -3323,7 +3323,7 @@ PHP_METHOD(DateTimeImmutable, add)
{
zval *object, *interval, new_object;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
@ -3380,7 +3380,7 @@ PHP_METHOD(DateTimeImmutable, sub)
{
zval *object, *interval, new_object;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &interval, date_ce_interval) == FAILURE) {
RETURN_FALSE;
}
@ -3485,7 +3485,7 @@ PHP_METHOD(DateTimeImmutable, setTimezone)
zval *object, new_object;
zval *timezone_object;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &timezone_object, date_ce_timezone) == FAILURE) {
RETURN_FALSE;
}
@ -3571,7 +3571,7 @@ PHP_METHOD(DateTimeImmutable, setTime)
zval *object, new_object;
zend_long h, i, s = 0, ms = 0;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|ll", &h, &i, &s, &ms) == FAILURE) {
RETURN_FALSE;
}
@ -3621,7 +3621,7 @@ PHP_METHOD(DateTimeImmutable, setDate)
zval *object, new_object;
zend_long y, m, d;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lll", &y, &m, &d) == FAILURE) {
RETURN_FALSE;
}
@ -3675,7 +3675,7 @@ PHP_METHOD(DateTimeImmutable, setISODate)
zval *object, new_object;
zend_long y, w, d = 1;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|l", &y, &w, &d) == FAILURE) {
RETURN_FALSE;
}
@ -3724,7 +3724,7 @@ PHP_METHOD(DateTimeImmutable, setTimestamp)
zval *object, new_object;
zend_long timestamp;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &timestamp) == FAILURE) {
RETURN_FALSE;
}
@ -3851,7 +3851,7 @@ PHP_METHOD(DateTimeZone, __construct)
ZEND_PARSE_PARAMETERS_END();
zend_replace_error_handling(EH_THROW, NULL, &error_handling);
tzobj = Z_PHPTIMEZONE_P(&EX(This));
tzobj = Z_PHPTIMEZONE_P(ZEND_THIS);
timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz));
zend_restore_error_handling(&error_handling);
}
@ -3906,7 +3906,7 @@ PHP_METHOD(DateTimeZone, __set_state)
* */
PHP_METHOD(DateTimeZone, __wakeup)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
php_timezone_obj *tzobj;
HashTable *myht;
@ -4309,7 +4309,7 @@ PHP_METHOD(DateInterval, __construct)
zend_replace_error_handling(EH_THROW, NULL, &error_handling);
if (date_interval_initialize(&reltime, ZSTR_VAL(interval_string), ZSTR_LEN(interval_string)) == SUCCESS) {
php_interval_obj *diobj = Z_PHPINTERVAL_P(&EX(This));
php_interval_obj *diobj = Z_PHPINTERVAL_P(ZEND_THIS);
diobj->diff = reltime;
diobj->initialized = 1;
}
@ -4407,7 +4407,7 @@ PHP_METHOD(DateInterval, __set_state)
*/
PHP_METHOD(DateInterval, __wakeup)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
php_interval_obj *intobj;
HashTable *myht;
@ -4583,7 +4583,7 @@ PHP_METHOD(DatePeriod, __construct)
}
}
dpobj = Z_PHPPERIOD_P(&EX(This));
dpobj = Z_PHPPERIOD_P(ZEND_THIS);
dpobj->current = NULL;
if (isostr) {
@ -4657,7 +4657,7 @@ PHP_METHOD(DatePeriod, getStartDate)
return;
}
dpobj = Z_PHPPERIOD_P(&EX(This));
dpobj = Z_PHPPERIOD_P(ZEND_THIS);
php_date_instantiate(dpobj->start_ce, return_value);
dateobj = Z_PHPDATE_P(return_value);
@ -4684,7 +4684,7 @@ PHP_METHOD(DatePeriod, getEndDate)
return;
}
dpobj = Z_PHPPERIOD_P(&EX(This));
dpobj = Z_PHPPERIOD_P(ZEND_THIS);
if (!dpobj->end) {
return;
@ -4715,7 +4715,7 @@ PHP_METHOD(DatePeriod, getDateInterval)
return;
}
dpobj = Z_PHPPERIOD_P(&EX(This));
dpobj = Z_PHPPERIOD_P(ZEND_THIS);
php_date_instantiate(date_ce_interval, return_value);
diobj = Z_PHPINTERVAL_P(return_value);
@ -5259,7 +5259,7 @@ PHP_METHOD(DatePeriod, __set_state)
*/
PHP_METHOD(DatePeriod, __wakeup)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
php_period_obj *period_obj;
HashTable *myht;

View File

@ -63,7 +63,7 @@ PHP_METHOD(domattr, __construct)
return;
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
@ -227,7 +227,7 @@ PHP_FUNCTION(dom_attr_is_id)
dom_object *intern;
xmlAttrPtr attrp;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}

View File

@ -63,7 +63,7 @@ PHP_METHOD(domcdatasection, __construct)
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode );

View File

@ -158,7 +158,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
int length;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &offset, &count) == FAILURE) {
return;
}
@ -206,7 +206,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
char *arg;
size_t arg_len;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
return;
}
@ -232,7 +232,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
size_t arg_len;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &offset, &arg, &arg_len) == FAILURE) {
return;
}
@ -280,7 +280,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
int length;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &offset, &count) == FAILURE) {
return;
}
@ -338,7 +338,7 @@ PHP_FUNCTION(dom_characterdata_replace_data)
size_t arg_len;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "lls", &offset, &count, &arg, &arg_len) == FAILURE) {
return;
}

View File

@ -63,7 +63,7 @@ PHP_METHOD(domcomment, __construct)
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {

View File

@ -700,7 +700,7 @@ PHP_FUNCTION(dom_document_create_element)
size_t name_len, value_len;
char *name, *value = NULL;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@ -733,7 +733,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
dom_object *intern;
int ret;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@ -763,7 +763,7 @@ PHP_FUNCTION(dom_document_create_text_node)
dom_object *intern;
char *value;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) {
return;
}
@ -793,7 +793,7 @@ PHP_FUNCTION(dom_document_create_comment)
dom_object *intern;
char *value;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) {
return;
}
@ -823,7 +823,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
dom_object *intern;
char *value;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) {
return;
}
@ -853,7 +853,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
dom_object *intern;
char *name, *value = NULL;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@ -890,7 +890,7 @@ PHP_FUNCTION(dom_document_create_attribute)
dom_object *intern;
char *name;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -926,7 +926,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
size_t name_len;
char *name;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -960,7 +960,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
char *name;
xmlChar *local;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -987,7 +987,7 @@ PHP_FUNCTION(dom_document_import_node)
int ret;
zend_bool recursive = 0;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &node, dom_node_class_entry, &recursive) == FAILURE) {
return;
}
@ -1047,7 +1047,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
int errorcode;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s|s", &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@ -1112,7 +1112,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
dom_object *intern;
int errorcode;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@ -1175,7 +1175,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
char *uri, *name;
xmlChar *local, *nsuri;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@ -1204,7 +1204,7 @@ PHP_FUNCTION(dom_document_get_element_by_id)
dom_object *intern;
char *idname;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &idname, &idname_len) == FAILURE) {
return;
}
@ -1242,7 +1242,7 @@ PHP_FUNCTION(dom_document_normalize_document)
xmlDocPtr docp;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@ -1287,7 +1287,7 @@ PHP_METHOD(domdocument, __construct)
docp->encoding = (const xmlChar *) xmlStrdup((xmlChar *) encoding);
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
if (intern != NULL) {
olddoc = (xmlDocPtr) dom_object_get_node(intern);
if (olddoc != NULL) {
@ -1582,7 +1582,7 @@ PHP_FUNCTION(dom_document_save)
char *file;
zend_long options = 0;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &file, &file_len, &options) == FAILURE) {
return;
}
@ -1629,7 +1629,7 @@ PHP_FUNCTION(dom_document_savexml)
int size, format, saveempty = 0;
zend_long options = 0;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O!l", &nodep, dom_node_class_entry, &options) == FAILURE) {
return;
}
@ -1737,7 +1737,7 @@ PHP_FUNCTION(dom_document_xinclude)
int err;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flags) == FAILURE) {
return;
}
@ -1782,7 +1782,7 @@ PHP_FUNCTION(dom_document_validate)
dom_object *intern;
xmlValidCtxt *cvp;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@ -1822,7 +1822,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
int is_valid;
char resolved_path[MAXPATHLEN + 1];
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &flags) == FAILURE) {
return;
}
@ -1921,7 +1921,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
int is_valid;
char resolved_path[MAXPATHLEN + 1];
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &source, &source_len) == FAILURE) {
return;
}
@ -2132,7 +2132,7 @@ PHP_FUNCTION(dom_document_save_html_file)
char *file;
const char *encoding;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &file, &file_len) == FAILURE) {
return;
}
@ -2173,7 +2173,7 @@ PHP_FUNCTION(dom_document_save_html)
int format;
dom_doc_propsptr doc_props;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(),
"|O!", &nodep, dom_node_class_entry)
== FAILURE) {
@ -2256,7 +2256,7 @@ PHP_METHOD(domdocument, registerNodeClass)
zend_class_entry *basece = dom_node_class_entry, *ce = NULL;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "CC!", &basece, &ce) == FAILURE) {
return;
}

View File

@ -64,7 +64,7 @@ PHP_METHOD(domdocumentfragment, __construct)
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode );
@ -118,7 +118,7 @@ PHP_METHOD(domdocumentfragment, appendXML) {
int err;
xmlNodePtr lst;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &data, &data_len) == FAILURE) {
return;
}

View File

@ -212,7 +212,7 @@ PHP_METHOD(domelement, __construct)
xmlNodeSetContentLen(nodep, (xmlChar *) value, value_len);
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode );
@ -325,7 +325,7 @@ PHP_FUNCTION(dom_element_get_attribute)
xmlNodePtr attr;
size_t name_len;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -369,7 +369,7 @@ PHP_FUNCTION(dom_element_set_attribute)
dom_object *intern;
char *name, *value;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@ -435,7 +435,7 @@ PHP_FUNCTION(dom_element_remove_attribute)
size_t name_len;
char *name;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -485,7 +485,7 @@ PHP_FUNCTION(dom_element_get_attribute_node)
dom_object *intern;
char *name;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -532,7 +532,7 @@ PHP_FUNCTION(dom_element_set_attribute_node)
dom_object *intern, *attrobj, *oldobj;
int ret;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_attr_class_entry) == FAILURE) {
return;
}
@ -599,7 +599,7 @@ PHP_FUNCTION(dom_element_remove_attribute_node)
dom_object *intern, *attrobj;
int ret;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_attr_class_entry) == FAILURE) {
return;
}
@ -638,7 +638,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name)
char *name;
xmlChar *local;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -666,7 +666,7 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
char *uri, *name;
xmlChar *strattr;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@ -749,7 +749,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
dom_object *intern;
int errorcode = 0, stricterror, is_xmlns = 0, name_valid;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!ss", &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@ -876,7 +876,7 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
size_t name_len, uri_len;
char *name, *uri;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@ -934,7 +934,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
int ret;
char *uri, *name;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@ -989,7 +989,7 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
dom_object *intern, *attrobj, *oldobj;
int ret;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_attr_class_entry) == FAILURE) {
return;
}
@ -1063,7 +1063,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns)
char *uri, *name;
xmlChar *local, *nsuri;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@ -1092,7 +1092,7 @@ PHP_FUNCTION(dom_element_has_attribute)
size_t name_len;
xmlNodePtr attr;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
return;
}
@ -1122,7 +1122,7 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
char *uri, *name;
xmlChar *value;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &uri_len, &name, &name_len) == FAILURE) {
return;
}
@ -1180,7 +1180,7 @@ PHP_FUNCTION(dom_element_set_id_attribute)
size_t name_len;
zend_bool is_id;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sb", &name, &name_len, &is_id) == FAILURE) {
return;
}
@ -1217,7 +1217,7 @@ PHP_FUNCTION(dom_element_set_id_attribute_ns)
char *uri, *name;
zend_bool is_id;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssb", &uri, &uri_len, &name, &name_len, &is_id) == FAILURE) {
return;
}
@ -1252,7 +1252,7 @@ PHP_FUNCTION(dom_element_set_id_attribute_node)
dom_object *intern, *attrobj;
zend_bool is_id;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &node, dom_attr_class_entry, &is_id) == FAILURE) {
return;
}

View File

@ -69,7 +69,7 @@ PHP_METHOD(domentityreference, __construct)
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {

View File

@ -138,7 +138,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
xmlNodePtr nodep;
xmlNotation *notep = NULL;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &named, &namedlen) == FAILURE) {
return;
}
@ -213,7 +213,7 @@ PHP_FUNCTION(dom_namednodemap_item)
xmlNodePtr nodep, curnode;
int count;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
return;
}
@ -278,7 +278,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
xmlNodePtr nodep;
xmlNotation *notep = NULL;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!s", &uri, &urilen, &named, &namedlen) == FAILURE) {
return;
}
@ -344,7 +344,7 @@ PHP_FUNCTION(dom_namednodemap_count)
zval *id;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}

View File

@ -929,7 +929,7 @@ PHP_FUNCTION(dom_node_insert_before)
dom_object *intern, *childobj, *refpobj;
int ret, stricterror;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|O!", &node, dom_node_class_entry, &ref, dom_node_class_entry) == FAILURE) {
return;
}
@ -1093,7 +1093,7 @@ PHP_FUNCTION(dom_node_replace_child)
int ret;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &newnode, dom_node_class_entry, &oldnode, dom_node_class_entry) == FAILURE) {
return;
}
@ -1180,7 +1180,7 @@ PHP_FUNCTION(dom_node_remove_child)
dom_object *intern, *childobj;
int ret, stricterror;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_node_class_entry) == FAILURE) {
return;
}
@ -1232,7 +1232,7 @@ PHP_FUNCTION(dom_node_append_child)
dom_object *intern, *childobj;
int ret, stricterror;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_node_class_entry) == FAILURE) {
return;
}
@ -1333,7 +1333,7 @@ PHP_FUNCTION(dom_node_has_child_nodes)
xmlNode *nodep;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@ -1364,7 +1364,7 @@ PHP_FUNCTION(dom_node_clone_node)
dom_object *intern;
zend_bool recursive = 0;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &recursive) == FAILURE) {
return;
}
@ -1424,7 +1424,7 @@ PHP_FUNCTION(dom_node_normalize)
xmlNode *nodep;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@ -1467,7 +1467,7 @@ PHP_FUNCTION(dom_node_has_attributes)
xmlNode *nodep;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@ -1505,7 +1505,7 @@ PHP_FUNCTION(dom_node_is_same_node)
xmlNodePtr nodeotherp, nodep;
dom_object *intern, *nodeotherobj;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &node, dom_node_class_entry) == FAILURE) {
return;
}
@ -1535,7 +1535,7 @@ PHP_FUNCTION(dom_node_lookup_prefix)
size_t uri_len = 0;
char *uri;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &uri, &uri_len) == FAILURE) {
return;
}
@ -1587,7 +1587,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
size_t uri_len = 0;
char *uri;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &uri, &uri_len) == FAILURE) {
return;
}
@ -1621,7 +1621,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
size_t prefix_len;
char *prefix;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &prefix, &prefix_len) == FAILURE) {
return;
}
@ -1700,7 +1700,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
xmlXPathContextPtr ctxp=NULL;
xmlXPathObjectPtr xpathobjp=NULL;
id = &EX(This);
id = ZEND_THIS;
if (mode == 0) {
if (zend_parse_parameters(ZEND_NUM_ARGS(),
"|bba!a!", &exclusive, &with_comments,

View File

@ -109,7 +109,7 @@ PHP_FUNCTION(dom_nodelist_count)
zval *id;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@ -139,7 +139,7 @@ PHP_FUNCTION(dom_nodelist_item)
xmlNodePtr nodep, curnode;
int count = 0;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &index) == FAILURE) {
return;
}

View File

@ -71,7 +71,7 @@ PHP_METHOD(domprocessinginstruction, __construct)
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode );

View File

@ -78,7 +78,7 @@ PHP_METHOD(domtext, __construct)
RETURN_FALSE;
}
intern = Z_DOMOBJ_P(&EX(This));
intern = Z_DOMOBJ_P(ZEND_THIS);
if (intern != NULL) {
oldnode = dom_object_get_node(intern);
if (oldnode != NULL) {
@ -145,7 +145,7 @@ PHP_FUNCTION(dom_text_split_text)
int length;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &offset) == FAILURE) {
return;
}
@ -201,7 +201,7 @@ PHP_FUNCTION(dom_text_is_whitespace_in_element_content)
xmlNodePtr node;
dom_object *intern;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
return;
}

View File

@ -84,7 +84,7 @@ PHP_DOM_EXPORT xmlNodePtr dom_object_get_node(dom_object *obj);
*ret = php_dom_create_object(obj, return_value, domobject)
#define DOM_GET_THIS(zval) \
do { zval = &EX(This); } while (0)
do { zval = ZEND_THIS; } while (0)
#define DOM_GET_THIS_OBJ(__ptr, __id, __prtype, __intern) \
DOM_GET_THIS(__id); \

View File

@ -268,7 +268,7 @@ PHP_METHOD(domxpath, __construct)
RETURN_FALSE;
}
intern = Z_XPATHOBJ_P(&EX(This));
intern = Z_XPATHOBJ_P(ZEND_THIS);
if (intern != NULL) {
oldctx = (xmlXPathContextPtr)intern->dom.ptr;
if (oldctx != NULL) {
@ -315,7 +315,7 @@ PHP_FUNCTION(dom_xpath_register_ns)
dom_xpath_object *intern;
unsigned char *prefix, *ns_uri;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &prefix, &prefix_len, &ns_uri, &ns_uri_len) == FAILURE) {
return;
}
@ -358,7 +358,7 @@ static void php_xpath_eval(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
xmlNsPtr *ns = NULL;
zend_bool register_node_ns = 1;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|O!b", &expr, &expr_len, &context, dom_node_class_entry, &register_node_ns) == FAILURE) {
return;
}

View File

@ -130,7 +130,7 @@ U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance)
U_CFUNC PHP_FUNCTION(breakiter_get_text)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -152,7 +152,7 @@ U_CFUNC PHP_FUNCTION(breakiter_set_text)
UText *ut = NULL;
zend_string *text;
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &text) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -186,7 +186,7 @@ static void _breakiter_no_args_ret_int32(
{
char *msg;
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
@ -210,7 +210,7 @@ static void _breakiter_int32_ret_int32(
char *msg;
zend_long arg;
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &arg) == FAILURE) {
spprintf(&msg, 0, "%s: bad arguments", func_name);
@ -287,7 +287,7 @@ U_CFUNC PHP_FUNCTION(breakiter_next)
U_CFUNC PHP_FUNCTION(breakiter_current)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -320,7 +320,7 @@ U_CFUNC PHP_FUNCTION(breakiter_is_boundary)
{
zend_long offset;
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l",
&offset) == FAILURE) {
@ -347,7 +347,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_locale)
{
zend_long locale_type;
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &locale_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -375,7 +375,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
{
zend_long key_type = 0;
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &key_type) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -400,7 +400,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_parts_iterator)
U_CFUNC PHP_FUNCTION(breakiter_get_error_code)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -420,7 +420,7 @@ U_CFUNC PHP_FUNCTION(breakiter_get_error_message)
{
zend_string* message = NULL;
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,

View File

@ -30,7 +30,7 @@ static inline CodePointBreakIterator *fetch_cpbi(BreakIterator_object *bio) {
U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,

View File

@ -94,7 +94,7 @@ U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = &EX(This);
return_value = ZEND_THIS;
_php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
zend_restore_error_handling(&error_handling);
}
@ -102,7 +102,7 @@ U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
U_CFUNC PHP_FUNCTION(rbbi_get_rules)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -129,7 +129,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules)
U_CFUNC PHP_FUNCTION(rbbi_get_rule_status)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -145,7 +145,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status)
U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -185,7 +185,7 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rule_status_vec)
U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
{
BREAKITER_METHOD_INIT_VARS;
object = &EX(This);
object = ZEND_THIS;
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,

View File

@ -220,7 +220,7 @@ U_CFUNC PHP_METHOD(IntlGregorianCalendar, __construct)
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = &EX(This);
return_value = ZEND_THIS;
_php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
zend_restore_error_handling(&error_handling);
}

View File

@ -79,7 +79,7 @@ PHP_METHOD( Collator, __construct )
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = &EX(This);
return_value = ZEND_THIS;
if (collator_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
if (!EG(exception)) {
zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);

View File

@ -40,7 +40,7 @@ extern "C" {
#define INTLITERATOR_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(IntlIterator, ii)
#define INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(INTL_ITERATOR, ii)
#define INTLITERATOR_METHOD_FETCH_OBJECT\
object = &EX(This); \
object = ZEND_THIS; \
INTLITERATOR_METHOD_FETCH_OBJECT_NO_CHECK; \
if (ii->iterator == NULL) { \
intl_errors_set(&ii->err, U_ILLEGAL_ARGUMENT_ERROR, "Found unconstructed IntlIterator", 0); \

View File

@ -125,7 +125,7 @@ static PHP_METHOD(UConverter, toUCallback) {
return;
}
php_converter_default_callback(return_value, &EX(This), reason, error);
php_converter_default_callback(return_value, ZEND_THIS, reason, error);
}
/* }}} */
@ -147,7 +147,7 @@ static PHP_METHOD(UConverter, fromUCallback) {
return;
}
php_converter_default_callback(return_value, &EX(This), reason, error);
php_converter_default_callback(return_value, ZEND_THIS, reason, error);
}
/* }}} */
@ -414,7 +414,7 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_set_encoding_arginfo, 0, ZEND_RETURN_VALUE,
ZEND_ARG_INFO(0, encoding)
ZEND_END_ARG_INFO();
static void php_converter_do_set_encoding(UConverter **pcnv, INTERNAL_FUNCTION_PARAMETERS) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
char *enc;
size_t enc_len;
@ -431,14 +431,14 @@ static void php_converter_do_set_encoding(UConverter **pcnv, INTERNAL_FUNCTION_P
/* {{{ proto bool UConverter::setSourceEncoding(string encoding) */
static PHP_METHOD(UConverter, setSourceEncoding) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_set_encoding(&(objval->src), INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
/* {{{ proto bool UConverter::setDestinationEncoding(string encoding) */
static PHP_METHOD(UConverter, setDestinationEncoding) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_set_encoding(&(objval->dest), INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
@ -472,14 +472,14 @@ static void php_converter_do_get_encoding(php_converter_object *objval, UConvert
/* {{{ proto string UConverter::getSourceEncoding() */
static PHP_METHOD(UConverter, getSourceEncoding) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_get_encoding(objval, objval->src, INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
/* {{{ proto string UConverter::getDestinationEncoding() */
static PHP_METHOD(UConverter, getDestinationEncoding) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_get_encoding(objval, objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
@ -512,14 +512,14 @@ static void php_converter_do_get_type(php_converter_object *objval, UConverter *
/* {{{ proto int UConverter::getSourceType() */
static PHP_METHOD(UConverter, getSourceType) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_get_type(objval, objval->src, INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
/* {{{ proto int UConverter::getDestinationType() */
static PHP_METHOD(UConverter, getDestinationType) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
php_converter_do_get_type(objval, objval->dest, INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
/* }}} */
@ -555,7 +555,7 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_arginfo, 0, ZEND_RETURN_VALUE, 0)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, __construct) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
char *src = "utf-8";
size_t src_len = sizeof("utf-8") - 1;
char *dest = src;
@ -569,8 +569,8 @@ static PHP_METHOD(UConverter, __construct) {
php_converter_set_encoding(objval, &(objval->src), src, src_len );
php_converter_set_encoding(objval, &(objval->dest), dest, dest_len);
php_converter_resolve_callback(&EX(This), objval, "toUCallback", &(objval->to_cb), &(objval->to_cache));
php_converter_resolve_callback(&EX(This), objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache));
php_converter_resolve_callback(ZEND_THIS, objval, "toUCallback", &(objval->to_cb), &(objval->to_cache));
php_converter_resolve_callback(ZEND_THIS, objval, "fromUCallback", &(objval->from_cb), &(objval->from_cache));
}
/* }}} */
@ -580,7 +580,7 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_setSubstChars_arginfo, 0, ZEND_RETURN_VALUE
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, setSubstChars) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
char *chars;
size_t chars_len;
int ret = 1;
@ -625,7 +625,7 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_getSubstChars_arginfo, 0, ZEND_RETURN_VALUE
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getSubstChars) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
char chars[127];
int8_t chars_len = sizeof(chars);
UErrorCode error = U_ZERO_ERROR;
@ -748,7 +748,7 @@ ZEND_BEGIN_ARG_INFO_EX(php_converter_convert_arginfo, 0, ZEND_RETURN_VALUE, 1)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, convert) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
char *str;
size_t str_len;
zend_string *ret;
@ -844,7 +844,7 @@ static PHP_METHOD(UConverter, transcode) {
ZEND_BEGIN_ARG_INFO_EX(php_converter_geterrorcode_arginfo, 0, ZEND_RETURN_VALUE, 0)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getErrorCode) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
@ -860,7 +860,7 @@ static PHP_METHOD(UConverter, getErrorCode) {
ZEND_BEGIN_ARG_INFO_EX(php_converter_geterrormsg_arginfo, 0, ZEND_RETURN_VALUE, 0)
ZEND_END_ARG_INFO();
static PHP_METHOD(UConverter, getErrorMessage) {
php_converter_object *objval = CONV_GET(&EX(This));
php_converter_object *objval = CONV_GET(ZEND_THIS);
zend_string *message = intl_error_get_message(&(objval->error));
if (zend_parse_parameters_none() == FAILURE) {

View File

@ -209,7 +209,7 @@ U_CFUNC PHP_METHOD( IntlDateFormatter, __construct )
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
/* return_value param is being changed, therefore we will always return
* NULL here */
return_value = &EX(This);
return_value = ZEND_THIS;
if (datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
if (!EG(exception)) {
zend_string *err = intl_error_get_message(NULL);

View File

@ -94,7 +94,7 @@ PHP_METHOD( NumberFormatter, __construct )
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = &EX(This);
return_value = ZEND_THIS;
if (numfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
if (!EG(exception)) {
zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);

View File

@ -113,7 +113,7 @@ PHP_METHOD( MessageFormatter, __construct )
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = &EX(This);
return_value = ZEND_THIS;
if (msgfmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
if (!EG(exception)) {
zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);

View File

@ -152,7 +152,7 @@ PHP_METHOD( ResourceBundle, __construct )
zend_error_handling error_handling;
zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = &EX(This);
return_value = ZEND_THIS;
if (resourcebundle_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1) == FAILURE) {
if (!EG(exception)) {
zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);

View File

@ -57,7 +57,7 @@ extern zend_class_entry *Spoofchecker_ce_ptr;
/* Auxiliary macros */
#define SPOOFCHECKER_METHOD_INIT_VARS \
zval* object = &EX(This); \
zval* object = ZEND_THIS; \
Spoofchecker_object* co = NULL; \
intl_error_reset(NULL); \

View File

@ -194,7 +194,7 @@ static char *dsn_from_uri(char *uri, char *buf, size_t buflen) /* {{{ */
*/
static PHP_METHOD(PDO, dbh_constructor)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
pdo_dbh_t *dbh = NULL;
zend_bool is_persistent = 0;
char *data_source;
@ -462,7 +462,7 @@ static PHP_METHOD(PDO, prepare)
size_t statement_len;
zval *options = NULL, *opt, *item, ctor_args;
zend_class_entry *dbstmt_ce, *pce;
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(&EX(This));
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS);
pdo_dbh_t *dbh = dbh_obj->inner;
ZEND_PARSE_PARAMETERS_START(1, 2)
@ -557,7 +557,7 @@ static PHP_METHOD(PDO, prepare)
Initiates a transaction */
static PHP_METHOD(PDO, beginTransaction)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -590,7 +590,7 @@ static PHP_METHOD(PDO, beginTransaction)
Commit a transaction */
static PHP_METHOD(PDO, commit)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -616,7 +616,7 @@ static PHP_METHOD(PDO, commit)
roll back a transaction */
static PHP_METHOD(PDO, rollBack)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -642,7 +642,7 @@ static PHP_METHOD(PDO, rollBack)
determine if inside a transaction */
static PHP_METHOD(PDO, inTransaction)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -815,7 +815,7 @@ fail:
Set an attribute */
static PHP_METHOD(PDO, setAttribute)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
zend_long attr;
zval *value;
@ -838,7 +838,7 @@ static PHP_METHOD(PDO, setAttribute)
Get an attribute */
static PHP_METHOD(PDO, getAttribute)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
zend_long attr;
ZEND_PARSE_PARAMETERS_START(1, 1)
@ -903,7 +903,7 @@ static PHP_METHOD(PDO, getAttribute)
Execute a query that does not return a row set, returning the number of affected rows */
static PHP_METHOD(PDO, exec)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
char *statement;
size_t statement_len;
zend_long ret;
@ -932,7 +932,7 @@ static PHP_METHOD(PDO, exec)
Returns the id of the last row that we affected on this connection. Some databases require a sequence or table name to be passed in. Not always meaningful. */
static PHP_METHOD(PDO, lastInsertId)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
char *name = NULL;
size_t namelen;
@ -966,7 +966,7 @@ static PHP_METHOD(PDO, lastInsertId)
Fetch the error code associated with the last operation on the database handle */
static PHP_METHOD(PDO, errorCode)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -997,7 +997,7 @@ static PHP_METHOD(PDO, errorInfo)
int error_count_diff = 0;
int error_expected_count = 3;
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1045,7 +1045,7 @@ static PHP_METHOD(PDO, query)
pdo_stmt_t *stmt;
char *statement;
size_t statement_len;
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(&EX(This));
pdo_dbh_object_t *dbh_obj = Z_PDO_OBJECT_P(ZEND_THIS);
pdo_dbh_t *dbh = dbh_obj->inner;
/* Return a meaningful error when no parameters were passed */
@ -1123,7 +1123,7 @@ static PHP_METHOD(PDO, query)
quotes string for use in a query. The optional paramtype acts as a hint for drivers that have alternate quoting styles. The default value is PDO_PARAM_STR */
static PHP_METHOD(PDO, quote)
{
pdo_dbh_t *dbh = Z_PDO_DBH_P(&EX(This));
pdo_dbh_t *dbh = Z_PDO_DBH_P(ZEND_THIS);
char *str;
size_t str_len;
zend_long paramtype = PDO_PARAM_STR;

View File

@ -106,7 +106,7 @@ ZEND_END_ARG_INFO()
/* }}} */
#define PHP_STMT_GET_OBJ \
pdo_stmt_t *stmt = Z_PDO_STMT_P(&EX(This)); \
pdo_stmt_t *stmt = Z_PDO_STMT_P(ZEND_THIS); \
if (!stmt->dbh) { \
RETURN_FALSE; \
} \

View File

@ -562,7 +562,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromArray)
RETURN_FALSE;
}
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
PDO_DBH_CLEAR_ERR();
@ -667,7 +667,7 @@ static PHP_METHOD(PDO, pgsqlCopyFromFile)
}
/* Obtain db Handler */
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
PDO_DBH_CLEAR_ERR();
@ -767,7 +767,7 @@ static PHP_METHOD(PDO, pgsqlCopyToFile)
return;
}
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
PDO_DBH_CLEAR_ERR();
@ -860,7 +860,7 @@ static PHP_METHOD(PDO, pgsqlCopyToArray)
return;
}
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
PDO_DBH_CLEAR_ERR();
@ -925,7 +925,7 @@ static PHP_METHOD(PDO, pgsqlLOBCreate)
pdo_pgsql_db_handle *H;
Oid lfd;
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
PDO_DBH_CLEAR_ERR();
@ -973,7 +973,7 @@ static PHP_METHOD(PDO, pgsqlLOBOpen)
mode = INV_READ|INV_WRITE;
}
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
PDO_DBH_CLEAR_ERR();
@ -982,7 +982,7 @@ static PHP_METHOD(PDO, pgsqlLOBOpen)
lfd = lo_open(H->server, oid, mode);
if (lfd >= 0) {
php_stream *stream = pdo_pgsql_create_lob_stream(&EX(This), lfd, oid);
php_stream *stream = pdo_pgsql_create_lob_stream(ZEND_THIS, lfd, oid);
if (stream) {
php_stream_to_zval(stream, return_value);
return;
@ -1016,7 +1016,7 @@ static PHP_METHOD(PDO, pgsqlLOBUnlink)
RETURN_FALSE;
}
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
PDO_DBH_CLEAR_ERR();
@ -1047,7 +1047,7 @@ static PHP_METHOD(PDO, pgsqlGetNotify)
RETURN_FALSE;
}
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
if (result_type == PDO_FETCH_USE_DEFAULT) {
@ -1112,7 +1112,7 @@ static PHP_METHOD(PDO, pgsqlGetPid)
pdo_dbh_t *dbh;
pdo_pgsql_db_handle *H;
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
H = (pdo_pgsql_db_handle *)dbh->driver_data;

View File

@ -529,7 +529,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
Z_PARAM_LONG(flags)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
if (!zend_is_callable(callback, 0, NULL)) {
@ -601,7 +601,7 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
Z_PARAM_LONG(argc)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
if (!zend_is_callable(step_callback, 0, NULL)) {
@ -661,7 +661,7 @@ static PHP_METHOD(SQLite, sqliteCreateCollation)
Z_PARAM_ZVAL(callback)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
dbh = Z_PDO_DBH_P(&EX(This));
dbh = Z_PDO_DBH_P(ZEND_THIS);
PDO_CONSTRUCT_CHECK;
if (!zend_is_callable(callback, 0, NULL)) {

View File

@ -1121,7 +1121,7 @@ PHP_METHOD(Phar, __construct)
zend_long format = 0;
phar_archive_object *phar_obj;
phar_archive_data *phar_data;
zval *zobj = &EX(This), arg1, arg2;
zval *zobj = ZEND_THIS, arg1, arg2;
phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
@ -1357,7 +1357,7 @@ PHP_METHOD(Phar, unlinkArchive)
/* }}} */
#define PHAR_ARCHIVE_OBJECT() \
zval *zobj = &EX(This); \
zval *zobj = ZEND_THIS; \
phar_archive_object *phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \
if (!phar_obj->archive) { \
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
@ -1370,7 +1370,7 @@ PHP_METHOD(Phar, unlinkArchive)
*/
PHP_METHOD(Phar, __destruct)
{
zval *zobj = &EX(This);
zval *zobj = ZEND_THIS;
phar_archive_object *phar_obj = (phar_archive_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
if (phar_obj->archive && phar_obj->archive->is_persistent) {
@ -4421,7 +4421,7 @@ PHP_METHOD(PharFileInfo, __construct)
phar_entry_object *entry_obj;
phar_entry_info *entry_info;
phar_archive_data *phar_data;
zval *zobj = &EX(This), arg1;
zval *zobj = ZEND_THIS, arg1;
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "p", &fname, &fname_len) == FAILURE) {
return;
@ -4477,7 +4477,7 @@ PHP_METHOD(PharFileInfo, __construct)
/* }}} */
#define PHAR_ENTRY_OBJECT() \
zval *zobj = &EX(This); \
zval *zobj = ZEND_THIS; \
phar_entry_object *entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset); \
if (!entry_obj->entry) { \
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, \
@ -4490,7 +4490,7 @@ PHP_METHOD(PharFileInfo, __construct)
*/
PHP_METHOD(PharFileInfo, __destruct)
{
zval *zobj = &EX(This);
zval *zobj = ZEND_THIS;
phar_entry_object *entry_obj = (phar_entry_object*)((char*)Z_OBJ_P(zobj) - Z_OBJ_P(zobj)->handlers->offset);
if (entry_obj->entry && entry_obj->entry->is_temp_dir) {

View File

@ -80,7 +80,7 @@ PHPAPI zend_class_entry *reflection_zend_extension_ptr;
return;
#define GET_REFLECTION_OBJECT() do { \
intern = Z_REFLECTION_P(&EX(This)); \
intern = Z_REFLECTION_P(ZEND_THIS); \
if (intern->ptr == NULL) { \
if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) { \
return; \
@ -1369,7 +1369,7 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO
reflection_object *intern;
parameter_reference *param;
intern = Z_REFLECTION_P(&EX(This));
intern = Z_REFLECTION_P(ZEND_THIS);
if (intern->ptr == NULL) {
if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) {
return NULL;
@ -1512,7 +1512,7 @@ ZEND_METHOD(reflection_function, __construct)
zend_function *fptr;
zend_string *fname, *lcname;
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &closure, zend_ce_closure) == SUCCESS) {
@ -1581,7 +1581,7 @@ ZEND_METHOD(reflection_function, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
_default_get_name(&EX(This), return_value);
_default_get_name(ZEND_THIS, return_value);
}
/* }}} */
@ -2070,7 +2070,7 @@ ZEND_METHOD(reflection_generator, __construct)
reflection_object *intern;
zend_execute_data *ex;
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "O", &generator, zend_ce_generator) == FAILURE) {
@ -2099,7 +2099,7 @@ ZEND_METHOD(reflection_generator, __construct)
ZEND_METHOD(reflection_generator, getTrace)
{
zend_long options = DEBUG_BACKTRACE_PROVIDE_OBJECT;
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(&EX(This))->obj);
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj);
zend_generator *root_generator;
zend_execute_data *ex_backup = EG(current_execute_data);
zend_execute_data *ex = generator->execute_data;
@ -2134,7 +2134,7 @@ ZEND_METHOD(reflection_generator, getTrace)
/* {{{ proto public int ReflectionGenerator::getExecutingLine() */
ZEND_METHOD(reflection_generator, getExecutingLine)
{
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(&EX(This))->obj);
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj);
zend_execute_data *ex = generator->execute_data;
if (zend_parse_parameters_none() == FAILURE) {
@ -2150,7 +2150,7 @@ ZEND_METHOD(reflection_generator, getExecutingLine)
/* {{{ proto public string ReflectionGenerator::getExecutingFile() */
ZEND_METHOD(reflection_generator, getExecutingFile)
{
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(&EX(This))->obj);
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj);
zend_execute_data *ex = generator->execute_data;
if (zend_parse_parameters_none() == FAILURE) {
@ -2166,7 +2166,7 @@ ZEND_METHOD(reflection_generator, getExecutingFile)
/* {{{ proto public ReflectionFunctionAbstract ReflectionGenerator::getFunction() */
ZEND_METHOD(reflection_generator, getFunction)
{
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(&EX(This))->obj);
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj);
zend_execute_data *ex = generator->execute_data;
if (zend_parse_parameters_none() == FAILURE) {
@ -2190,7 +2190,7 @@ ZEND_METHOD(reflection_generator, getFunction)
/* {{{ proto public object ReflectionGenerator::getThis() */
ZEND_METHOD(reflection_generator, getThis)
{
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(&EX(This))->obj);
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj);
zend_execute_data *ex = generator->execute_data;
if (zend_parse_parameters_none() == FAILURE) {
@ -2210,7 +2210,7 @@ ZEND_METHOD(reflection_generator, getThis)
/* {{{ proto public Generator ReflectionGenerator::getExecutingGenerator() */
ZEND_METHOD(reflection_generator, getExecutingGenerator)
{
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(&EX(This))->obj);
zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj);
zend_execute_data *ex = generator->execute_data;
zend_generator *current;
@ -2255,7 +2255,7 @@ ZEND_METHOD(reflection_parameter, __construct)
return;
}
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
/* First, find the function */
@ -2448,7 +2448,7 @@ ZEND_METHOD(reflection_parameter, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
_default_get_name(&EX(This), return_value);
_default_get_name(ZEND_THIS, return_value);
}
/* }}} */
@ -2948,7 +2948,7 @@ ZEND_METHOD(reflection_method, __construct)
orig_obj = NULL;
}
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
/* Find the class entry */
@ -3085,7 +3085,7 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, int variadic)
"Trying to invoke %s method %s::%s() from scope %s",
mptr->common.fn_flags & ZEND_ACC_PROTECTED ? "protected" : "private",
ZSTR_VAL(mptr->common.scope->name), ZSTR_VAL(mptr->common.function_name),
ZSTR_VAL(Z_OBJCE(EX(This))->name));
ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
@ -3277,7 +3277,7 @@ ZEND_METHOD(reflection_function, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if ((name = _default_load_name(&EX(This))) == NULL) {
if ((name = _default_load_name(ZEND_THIS)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@ -3300,7 +3300,7 @@ ZEND_METHOD(reflection_function, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if ((name = _default_load_name(&EX(This))) == NULL) {
if ((name = _default_load_name(ZEND_THIS)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@ -3323,7 +3323,7 @@ ZEND_METHOD(reflection_function, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if ((name = _default_load_name(&EX(This))) == NULL) {
if ((name = _default_load_name(ZEND_THIS)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@ -3476,7 +3476,7 @@ ZEND_METHOD(reflection_method, setAccessible)
return;
}
intern = Z_REFLECTION_P(&EX(This));
intern = Z_REFLECTION_P(ZEND_THIS);
intern->ignore_visibility = visible;
}
@ -3496,7 +3496,7 @@ ZEND_METHOD(reflection_class_constant, __construct)
return;
}
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
/* Find the class entry */
@ -3548,7 +3548,7 @@ ZEND_METHOD(reflection_class_constant, __toString)
return;
}
GET_REFLECTION_OBJECT_PTR(ref);
_default_get_name(&EX(This), &name);
_default_get_name(ZEND_THIS, &name);
_class_const_string(&str, Z_STRVAL(name), ref, "");
zval_ptr_dtor(&name);
RETURN_STR(smart_str_extract(&str));
@ -3562,7 +3562,7 @@ ZEND_METHOD(reflection_class_constant, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
_default_get_name(&EX(This), return_value);
_default_get_name(ZEND_THIS, return_value);
}
/* }}} */
@ -3699,7 +3699,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
}
}
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
if (Z_TYPE_P(argument) == IS_OBJECT) {
@ -3906,7 +3906,7 @@ ZEND_METHOD(reflection_class, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
_default_get_name(&EX(This), return_value);
_default_get_name(ZEND_THIS, return_value);
}
/* }}} */
@ -5094,7 +5094,7 @@ ZEND_METHOD(reflection_class, inNamespace)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if ((name = _default_load_name(&EX(This))) == NULL) {
if ((name = _default_load_name(ZEND_THIS)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@ -5117,7 +5117,7 @@ ZEND_METHOD(reflection_class, getNamespaceName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if ((name = _default_load_name(&EX(This))) == NULL) {
if ((name = _default_load_name(ZEND_THIS)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@ -5140,7 +5140,7 @@ ZEND_METHOD(reflection_class, getShortName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if ((name = _default_load_name(&EX(This))) == NULL) {
if ((name = _default_load_name(ZEND_THIS)) == NULL) {
RETURN_FALSE;
}
if (Z_TYPE_P(name) == IS_STRING
@ -5202,7 +5202,7 @@ ZEND_METHOD(reflection_property, __construct)
return;
}
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
/* Find the class entry */
@ -5305,7 +5305,7 @@ ZEND_METHOD(reflection_property, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
_default_get_name(&EX(This), return_value);
_default_get_name(ZEND_THIS, return_value);
}
/* }}} */
@ -5398,7 +5398,7 @@ ZEND_METHOD(reflection_property, getValue)
GET_REFLECTION_OBJECT_PTR(ref);
if (!(ref->prop.flags & ZEND_ACC_PUBLIC) && intern->ignore_visibility == 0) {
name = _default_load_name(&EX(This));
name = _default_load_name(ZEND_THIS);
zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot access non-public member %s::$%s", ZSTR_VAL(intern->ce->name), Z_STRVAL_P(name));
return;
@ -5447,7 +5447,7 @@ ZEND_METHOD(reflection_property, setValue)
GET_REFLECTION_OBJECT_PTR(ref);
if (!(ref->prop.flags & ZEND_ACC_PUBLIC) && intern->ignore_visibility == 0) {
name = _default_load_name(&EX(This));
name = _default_load_name(ZEND_THIS);
zend_throw_exception_ex(reflection_exception_ptr, 0,
"Cannot access non-public member %s::$%s", ZSTR_VAL(intern->ce->name), Z_STRVAL_P(name));
return;
@ -5532,7 +5532,7 @@ ZEND_METHOD(reflection_property, setAccessible)
return;
}
intern = Z_REFLECTION_P(&EX(This));
intern = Z_REFLECTION_P(ZEND_THIS);
intern->ignore_visibility = visible;
}
@ -5563,7 +5563,7 @@ ZEND_METHOD(reflection_extension, __construct)
return;
}
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
lcname = do_alloca(name_len + 1, use_heap);
zend_str_tolower_copy(lcname, name_str, name_len);
@ -5606,7 +5606,7 @@ ZEND_METHOD(reflection_extension, getName)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
_default_get_name(&EX(This), return_value);
_default_get_name(ZEND_THIS, return_value);
}
/* }}} */
@ -5919,7 +5919,7 @@ ZEND_METHOD(reflection_zend_extension, __construct)
return;
}
object = &EX(This);
object = ZEND_THIS;
intern = Z_REFLECTION_P(object);
extension = zend_get_extension(name_str);

View File

@ -1293,7 +1293,7 @@ SXE_METHOD(xpath)
return;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
return; /* attributes don't have attributes */
@ -1378,7 +1378,7 @@ SXE_METHOD(registerXPathNamespace)
return;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
if (!sxe->xpath) {
sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr);
}
@ -1412,7 +1412,7 @@ SXE_METHOD(asXML)
RETURN_FALSE;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@ -1441,7 +1441,7 @@ SXE_METHOD(asXML)
}
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@ -1543,7 +1543,7 @@ SXE_METHOD(getNamespaces)
array_init(return_value);
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@ -1590,7 +1590,7 @@ SXE_METHOD(getDocNamespaces)
return;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
if(from_root){
node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr);
}else{
@ -1620,7 +1620,7 @@ SXE_METHOD(children)
return;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
return; /* attributes don't have attributes */
@ -1642,7 +1642,7 @@ SXE_METHOD(getName)
xmlNodePtr node;
int namelen;
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@ -1669,7 +1669,7 @@ SXE_METHOD(attributes)
return;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
@ -1703,7 +1703,7 @@ SXE_METHOD(addChild)
return;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
if (sxe->iter.type == SXE_ITER_ATTRLIST) {
@ -1769,7 +1769,7 @@ SXE_METHOD(addAttribute)
return;
}
sxe = Z_SXEOBJ_P(&EX(This));
sxe = Z_SXEOBJ_P(ZEND_THIS);
GET_NODE(sxe, node);
node = php_sxe_get_first_node(sxe, node);
@ -1921,7 +1921,7 @@ static int sxe_object_cast(zval *readobj, zval *writeobj, int type)
Returns the string content */
SXE_METHOD(__toString)
{
if (sxe_object_cast_ex(&EX(This), return_value, IS_STRING) != SUCCESS) {
if (sxe_object_cast_ex(ZEND_THIS, return_value, IS_STRING) != SUCCESS) {
zval_ptr_dtor(return_value);
RETURN_EMPTY_STRING();
}
@ -1978,7 +1978,7 @@ static int sxe_count_elements(zval *object, zend_long *count) /* {{{ */
SXE_METHOD(count)
{
zend_long count = 0;
php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2255,7 +2255,7 @@ PHP_FUNCTION(simplexml_load_string)
SimpleXMLElement constructor */
SXE_METHOD(__construct)
{
php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
char *data, *ns = NULL;
size_t data_len, ns_len = 0;
xmlDocPtr docp;

View File

@ -43,7 +43,7 @@ PHP_METHOD(ce_SimpleXMLIterator, rewind)
return;
}
php_sxe_rewind_iterator(Z_SXEOBJ_P(&EX(This)));
php_sxe_rewind_iterator(Z_SXEOBJ_P(ZEND_THIS));
}
/* }}} */
@ -51,7 +51,7 @@ PHP_METHOD(ce_SimpleXMLIterator, rewind)
Check whether iteration is valid */
PHP_METHOD(ce_SimpleXMLIterator, valid)
{
php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -65,7 +65,7 @@ PHP_METHOD(ce_SimpleXMLIterator, valid)
Get current element */
PHP_METHOD(ce_SimpleXMLIterator, current)
{
php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
zval *data;
if (zend_parse_parameters_none() == FAILURE) {
@ -87,7 +87,7 @@ PHP_METHOD(ce_SimpleXMLIterator, key)
{
xmlNodePtr curnode;
php_sxe_object *intern;
php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -115,7 +115,7 @@ PHP_METHOD(ce_SimpleXMLIterator, next)
return;
}
php_sxe_move_forward_iterator(Z_SXEOBJ_P(&EX(This)));
php_sxe_move_forward_iterator(Z_SXEOBJ_P(ZEND_THIS));
}
/* }}} */
@ -123,7 +123,7 @@ PHP_METHOD(ce_SimpleXMLIterator, next)
Check whether element has children (elements) */
PHP_METHOD(ce_SimpleXMLIterator, hasChildren)
{
php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
php_sxe_object *child;
xmlNodePtr node;
@ -151,7 +151,7 @@ PHP_METHOD(ce_SimpleXMLIterator, hasChildren)
Get child element iterator */
PHP_METHOD(ce_SimpleXMLIterator, getChildren)
{
php_sxe_object *sxe = Z_SXEOBJ_P(&EX(This));
php_sxe_object *sxe = Z_SXEOBJ_P(ZEND_THIS);
zval *data;
if (zend_parse_parameters_none() == FAILURE) {

View File

@ -1748,7 +1748,7 @@ PHP_FUNCTION(snmp_read_mib)
PHP_METHOD(snmp, __construct)
{
php_snmp_object *snmp_object;
zval *object = &EX(This);
zval *object = ZEND_THIS;
char *a1, *a2;
size_t a1_len, a2_len;
zend_long timeout = SNMP_DEFAULT_TIMEOUT;
@ -1795,7 +1795,7 @@ PHP_METHOD(snmp, __construct)
PHP_METHOD(snmp, close)
{
php_snmp_object *snmp_object;
zval *object = &EX(This);
zval *object = ZEND_THIS;
snmp_object = Z_SNMP_P(object);
@ -1846,7 +1846,7 @@ PHP_METHOD(snmp, set)
PHP_METHOD(snmp, setSecurity)
{
php_snmp_object *snmp_object;
zval *object = &EX(This);
zval *object = ZEND_THIS;
char *a1 = "", *a2 = "", *a3 = "", *a4 = "", *a5 = "", *a6 = "", *a7 = "";
size_t a1_len = 0, a2_len = 0, a3_len = 0, a4_len = 0, a5_len = 0, a6_len = 0, a7_len = 0;
int argc = ZEND_NUM_ARGS();
@ -1871,7 +1871,7 @@ PHP_METHOD(snmp, setSecurity)
PHP_METHOD(snmp, getErrno)
{
php_snmp_object *snmp_object;
zval *object = &EX(This);
zval *object = ZEND_THIS;
snmp_object = Z_SNMP_P(object);
@ -1885,7 +1885,7 @@ PHP_METHOD(snmp, getErrno)
PHP_METHOD(snmp, getError)
{
php_snmp_object *snmp_object;
zval *object = &EX(This);
zval *object = ZEND_THIS;
snmp_object = Z_SNMP_P(object);

View File

@ -77,7 +77,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
int _old_soap_version = SOAP_GLOBAL(soap_version);\
SOAP_GLOBAL(use_soap_error_handler) = 1;\
SOAP_GLOBAL(error_code) = "Server";\
Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This));
Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ_P(ZEND_THIS);
#define SOAP_SERVER_END_CODE() \
SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\
@ -96,7 +96,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
int _bailout = 0;\
SOAP_GLOBAL(use_soap_error_handler) = 1;\
SOAP_GLOBAL(error_code) = "Client";\
Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This));\
Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ_P(ZEND_THIS);\
zend_try {
#define SOAP_CLIENT_END_CODE() \
@ -130,7 +130,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
#define FETCH_THIS_SDL(ss) \
{ \
zval *__tmp; \
if(FIND_SDL_PROPERTY(&EX(This), __tmp) != NULL) { \
if(FIND_SDL_PROPERTY(ZEND_THIS, __tmp) != NULL) { \
FETCH_SDL_RES(ss,__tmp); \
} else { \
ss = NULL; \
@ -146,7 +146,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
#define FETCH_THIS_SERVICE(ss) \
{ \
zval *tmp; \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(&EX(This)),"service", sizeof("service")-1)) != NULL) { \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(ZEND_THIS),"service", sizeof("service")-1)) != NULL) { \
ss = (soapServicePtr)zend_fetch_resource_ex(tmp, "service", le_service); \
} else { \
php_error_docref(NULL, E_WARNING, "Can not fetch service object"); \
@ -802,7 +802,7 @@ PHP_METHOD(SoapParam, SoapParam)
return;
}
this_ptr = &EX(This);
this_ptr = ZEND_THIS;
add_property_stringl(this_ptr, "param_name", name, name_length);
add_property_zval(this_ptr, "param_data", data);
}
@ -831,7 +831,7 @@ PHP_METHOD(SoapHeader, SoapHeader)
return;
}
this_ptr = &EX(This);
this_ptr = ZEND_THIS;
add_property_stringl(this_ptr, "namespace", ns, ns_len);
add_property_stringl(this_ptr, "name", name, name_len);
if (data) {
@ -894,7 +894,7 @@ PHP_METHOD(SoapFault, SoapFault)
name = NULL;
}
this_ptr = &EX(This);
this_ptr = ZEND_THIS;
set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name);
if (headerfault != NULL) {
add_property_zval(this_ptr, "headerfault", headerfault);
@ -918,7 +918,7 @@ PHP_METHOD(SoapFault, __toString)
return;
}
this_ptr = &EX(This);
this_ptr = ZEND_THIS;
faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1, &rv1);
faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1, &rv2);
file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1, &rv3);
@ -926,7 +926,7 @@ PHP_METHOD(SoapFault, __toString)
fci.size = sizeof(fci);
ZVAL_STRINGL(&fci.function_name, "gettraceasstring", sizeof("gettraceasstring")-1);
fci.object = Z_OBJ(EX(This));
fci.object = Z_OBJ_P(ZEND_THIS);
fci.retval = &trace;
fci.param_count = 0;
fci.params = NULL;
@ -967,7 +967,7 @@ PHP_METHOD(SoapVar, SoapVar)
return;
}
this_ptr = &EX(This);
this_ptr = ZEND_THIS;
if (Z_TYPE_P(type) == IS_NULL) {
add_property_long(this_ptr, "enc_type", UNKNOWN_TYPE);
} else {
@ -1207,7 +1207,7 @@ PHP_METHOD(SoapServer, SoapServer)
service->soap_functions.ft = zend_new_array(0);
if (Z_TYPE_P(wsdl) != IS_NULL) {
service->sdl = get_sdl(&EX(This), Z_STRVAL_P(wsdl), cache_wsdl);
service->sdl = get_sdl(ZEND_THIS, Z_STRVAL_P(wsdl), cache_wsdl);
if (service->uri == NULL) {
if (service->sdl->target_ns) {
service->uri = estrdup(service->sdl->target_ns);
@ -1223,7 +1223,7 @@ PHP_METHOD(SoapServer, SoapServer)
}
res = zend_register_resource(service, le_service);
add_property_resource(&EX(This), "service", res);
add_property_resource(ZEND_THIS, "service", res);
SOAP_SERVER_END_CODE();
}
@ -1647,7 +1647,7 @@ PHP_METHOD(SoapServer, handle)
if (EG(exception)) {
php_output_discard();
_soap_server_exception(service, function, &EX(This));
_soap_server_exception(service, function, ZEND_THIS);
goto fail;
}
@ -1694,7 +1694,7 @@ PHP_METHOD(SoapServer, handle)
}
if (EG(exception)) {
php_output_discard();
_soap_server_exception(service, function, &EX(This));
_soap_server_exception(service, function, ZEND_THIS);
zval_ptr_dtor_str(&constructor);
zval_ptr_dtor(&c_ret);
zval_ptr_dtor(&tmp_soap);
@ -1717,7 +1717,7 @@ PHP_METHOD(SoapServer, handle)
if (EG(exception)) {
php_output_discard();
_soap_server_exception(service, function, &EX(This));
_soap_server_exception(service, function, ZEND_THIS);
zval_ptr_dtor_str(&constructor);
zval_ptr_dtor(&c_ret);
efree(class_name);
@ -1804,7 +1804,7 @@ PHP_METHOD(SoapServer, handle)
goto fail;
} else if (EG(exception)) {
php_output_discard();
_soap_server_exception(service, function, &EX(This));
_soap_server_exception(service, function, ZEND_THIS);
efree(fn_name);
if (service->type == SOAP_CLASS && soap_obj) {zval_ptr_dtor(soap_obj);}
goto fail;
@ -1843,7 +1843,7 @@ PHP_METHOD(SoapServer, handle)
if (EG(exception)) {
php_output_discard();
_soap_server_exception(service, function, &EX(This));
_soap_server_exception(service, function, ZEND_THIS);
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
@ -1882,7 +1882,7 @@ PHP_METHOD(SoapServer, handle)
if (EG(exception)) {
php_output_discard();
_soap_server_exception(service, function, &EX(This));
_soap_server_exception(service, function, ZEND_THIS);
if (service->type == SOAP_CLASS) {
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
if (soap_obj && service->soap_class.persistence != SOAP_PERSISTENCE_SESSION) {
@ -2259,7 +2259,7 @@ PHP_METHOD(SoapClient, SoapClient)
zend_long cache_wsdl;
sdlPtr sdl = NULL;
HashTable *typemap_ht = NULL;
zval *this_ptr = &EX(This);
zval *this_ptr = ZEND_THIS;
SOAP_CLIENT_BEGIN_CODE();
@ -2849,7 +2849,7 @@ PHP_METHOD(SoapClient, __call)
}
/* Add default headers */
this_ptr = &EX(This);
this_ptr = ZEND_THIS;
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__default_headers", sizeof("__default_headers")-1)) != NULL && Z_TYPE_P(tmp) == IS_ARRAY) {
HashTable *default_headers = Z_ARRVAL_P(tmp);
if (soap_headers) {
@ -2963,7 +2963,7 @@ PHP_METHOD(SoapClient, __getLastRequest)
return;
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(&EX(This)), "__last_request", sizeof("__last_request")-1)) != NULL &&
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(ZEND_THIS), "__last_request", sizeof("__last_request")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
RETURN_STR_COPY(Z_STR_P(tmp));
}
@ -2982,7 +2982,7 @@ PHP_METHOD(SoapClient, __getLastResponse)
return;
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(&EX(This)), "__last_response", sizeof("__last_response")-1)) != NULL &&
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(ZEND_THIS), "__last_response", sizeof("__last_response")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
RETURN_STR_COPY(Z_STR_P(tmp));
}
@ -3001,7 +3001,7 @@ PHP_METHOD(SoapClient, __getLastRequestHeaders)
return;
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(&EX(This)), "__last_request_headers", sizeof("__last_request_headers")-1)) != NULL &&
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(ZEND_THIS), "__last_request_headers", sizeof("__last_request_headers")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
RETURN_STR_COPY(Z_STR_P(tmp));
}
@ -3020,7 +3020,7 @@ PHP_METHOD(SoapClient, __getLastResponseHeaders)
return;
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(&EX(This)), "__last_response_headers", sizeof("__last_response_headers")-1)) != NULL &&
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(ZEND_THIS), "__last_response_headers", sizeof("__last_response_headers")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
RETURN_STR_COPY(Z_STR_P(tmp));
}
@ -3038,7 +3038,7 @@ PHP_METHOD(SoapClient, __doRequest)
size_t location_size, action_size;
zend_long version;
zend_long one_way = 0;
zval *this_ptr = &EX(This);
zval *this_ptr = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|l",
&buf,
@ -3072,7 +3072,7 @@ PHP_METHOD(SoapClient, __setCookie)
char *val = NULL;
size_t name_len, val_len = 0;
zval *cookies;
zval *this_ptr = &EX(This);
zval *this_ptr = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &name, &name_len, &val, &val_len) == FAILURE) {
return;
@ -3112,7 +3112,7 @@ PHP_METHOD(SoapClient, __getCookies)
}
if ((cookies = zend_hash_str_find(Z_OBJPROP_P(&EX(This)), "_cookies", sizeof("_cookies")-1)) != NULL &&
if ((cookies = zend_hash_str_find(Z_OBJPROP_P(ZEND_THIS), "_cookies", sizeof("_cookies")-1)) != NULL &&
Z_TYPE_P(cookies) == IS_ARRAY) {
RETURN_ARR(zend_array_dup(Z_ARRVAL_P(cookies)));
} else {
@ -3128,7 +3128,7 @@ PHP_METHOD(SoapClient, __getCookies)
PHP_METHOD(SoapClient, __setSoapHeaders)
{
zval *headers = NULL;
zval *this_ptr = &EX(This);
zval *this_ptr = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &headers) == FAILURE) {
return;
@ -3168,7 +3168,7 @@ PHP_METHOD(SoapClient, __setLocation)
char *location = NULL;
size_t location_len = 0;
zval *tmp;
zval *this_ptr = &EX(This);
zval *this_ptr = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &location, &location_len) == FAILURE) {
return;

View File

@ -708,7 +708,7 @@ SPL_METHOD(Array, offsetExists)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
RETURN_BOOL(spl_array_has_dimension_ex(0, &EX(This), index, 2));
RETURN_BOOL(spl_array_has_dimension_ex(0, ZEND_THIS, index, 2));
} /* }}} */
/* {{{ proto mixed ArrayObject::offsetGet(mixed $index)
@ -720,7 +720,7 @@ SPL_METHOD(Array, offsetGet)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
value = spl_array_read_dimension_ex(0, &EX(This), index, BP_VAR_R, return_value);
value = spl_array_read_dimension_ex(0, ZEND_THIS, index, BP_VAR_R, return_value);
if (value != return_value) {
ZVAL_COPY_DEREF(return_value, value);
}
@ -735,7 +735,7 @@ SPL_METHOD(Array, offsetSet)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &index, &value) == FAILURE) {
return;
}
spl_array_write_dimension_ex(0, &EX(This), index, value);
spl_array_write_dimension_ex(0, ZEND_THIS, index, value);
} /* }}} */
void spl_array_iterator_append(zval *object, zval *append_value) /* {{{ */
@ -760,7 +760,7 @@ SPL_METHOD(Array, append)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
spl_array_iterator_append(&EX(This), value);
spl_array_iterator_append(ZEND_THIS, value);
} /* }}} */
/* {{{ proto void ArrayObject::offsetUnset(mixed $index)
@ -772,7 +772,7 @@ SPL_METHOD(Array, offsetUnset)
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &index) == FAILURE) {
return;
}
spl_array_unset_dimension_ex(0, &EX(This), index);
spl_array_unset_dimension_ex(0, ZEND_THIS, index);
} /* }}} */
/* {{{ proto array ArrayObject::getArrayCopy()
@ -780,7 +780,7 @@ SPL_METHOD(Array, offsetUnset)
Return a copy of the contained array */
SPL_METHOD(Array, getArrayCopy)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
RETURN_ARR(zend_array_dup(spl_array_get_hash_table(intern)));
@ -1177,7 +1177,7 @@ zend_object_iterator *spl_array_get_iterator(zend_class_entry *ce, zval *object,
Constructs a new array object from an array or object. */
SPL_METHOD(Array, __construct)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern;
zval *array;
zend_long ar_flags = 0;
@ -1207,7 +1207,7 @@ SPL_METHOD(Array, __construct)
Constructs a new array iterator from an array or object. */
SPL_METHOD(ArrayIterator, __construct)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern;
zval *array;
zend_long ar_flags = 0;
@ -1232,7 +1232,7 @@ SPL_METHOD(ArrayIterator, __construct)
Set the class used in getIterator. */
SPL_METHOD(Array, setIteratorClass)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_class_entry * ce_get_iterator = spl_ce_Iterator;
@ -1248,7 +1248,7 @@ SPL_METHOD(Array, setIteratorClass)
Get the class used in getIterator. */
SPL_METHOD(Array, getIteratorClass)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1264,7 +1264,7 @@ SPL_METHOD(Array, getIteratorClass)
Get flags */
SPL_METHOD(Array, getFlags)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1279,7 +1279,7 @@ SPL_METHOD(Array, getFlags)
Set flags */
SPL_METHOD(Array, setFlags)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
zend_long ar_flags = 0;
@ -1295,7 +1295,7 @@ SPL_METHOD(Array, setFlags)
Replace the referenced array or object with a new one and return the old one (right now copy - to be changed) */
SPL_METHOD(Array, exchangeArray)
{
zval *object = &EX(This), *array;
zval *object = ZEND_THIS, *array;
spl_array_object *intern = Z_SPLARRAY_P(object);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &array) == FAILURE) {
@ -1316,7 +1316,7 @@ SPL_METHOD(Array, exchangeArray)
Create a new iterator from a ArrayObject instance */
SPL_METHOD(Array, getIterator)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1331,7 +1331,7 @@ SPL_METHOD(Array, getIterator)
Rewind array back to the start */
SPL_METHOD(Array, rewind)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1347,7 +1347,7 @@ SPL_METHOD(Array, rewind)
SPL_METHOD(Array, seek)
{
zend_long opos, position;
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *aht = spl_array_get_hash_table(intern);
int result;
@ -1416,7 +1416,7 @@ int spl_array_object_count_elements(zval *object, zend_long *count) /* {{{ */
Return the number of elements in the Iterator. */
SPL_METHOD(Array, count)
{
spl_array_object *intern = Z_SPLARRAY_P(&EX(This));
spl_array_object *intern = Z_SPLARRAY_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1427,7 +1427,7 @@ SPL_METHOD(Array, count)
static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fname_len, int use_arg) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(&EX(This));
spl_array_object *intern = Z_SPLARRAY_P(ZEND_THIS);
HashTable *aht = spl_array_get_hash_table(intern);
zval function_name, params[2], *arg = NULL;
@ -1516,7 +1516,7 @@ SPL_ARRAY_METHOD(Array, natcasesort, SPL_ARRAY_METHOD_NO_ARG) /* }}} */
Return current array entry */
SPL_METHOD(Array, current)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
zval *entry;
HashTable *aht = spl_array_get_hash_table(intern);
@ -1546,7 +1546,7 @@ SPL_METHOD(Array, key)
return;
}
spl_array_iterator_key(&EX(This), return_value);
spl_array_iterator_key(ZEND_THIS, return_value);
} /* }}} */
void spl_array_iterator_key(zval *object, zval *return_value) /* {{{ */
@ -1562,7 +1562,7 @@ void spl_array_iterator_key(zval *object, zval *return_value) /* {{{ */
Move to next entry */
SPL_METHOD(Array, next)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *aht = spl_array_get_hash_table(intern);
@ -1578,7 +1578,7 @@ SPL_METHOD(Array, next)
Check whether array contains more entries */
SPL_METHOD(Array, valid)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *aht = spl_array_get_hash_table(intern);
@ -1594,7 +1594,7 @@ SPL_METHOD(Array, valid)
Check whether current element has children (e.g. is an array) */
SPL_METHOD(Array, hasChildren)
{
zval *object = &EX(This), *entry;
zval *object = ZEND_THIS, *entry;
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *aht = spl_array_get_hash_table(intern);
@ -1619,7 +1619,7 @@ SPL_METHOD(Array, hasChildren)
Create a sub iterator for the current element (same class as $this) */
SPL_METHOD(Array, getChildren)
{
zval *object = &EX(This), *entry, flags;
zval *object = ZEND_THIS, *entry, flags;
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *aht = spl_array_get_hash_table(intern);
@ -1640,7 +1640,7 @@ SPL_METHOD(Array, getChildren)
if ((intern->ar_flags & SPL_ARRAY_CHILD_ARRAYS_ONLY) != 0) {
return;
}
if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE(EX(This)))) {
if (instanceof_function(Z_OBJCE_P(entry), Z_OBJCE_P(ZEND_THIS))) {
ZVAL_OBJ(return_value, Z_OBJ_P(entry));
Z_ADDREF_P(return_value);
return;
@ -1648,7 +1648,7 @@ SPL_METHOD(Array, getChildren)
}
ZVAL_LONG(&flags, intern->ar_flags);
spl_instantiate_arg_ex2(Z_OBJCE(EX(This)), return_value, entry, &flags);
spl_instantiate_arg_ex2(Z_OBJCE_P(ZEND_THIS), return_value, entry, &flags);
}
/* }}} */
@ -1656,7 +1656,7 @@ SPL_METHOD(Array, getChildren)
Serialize the object */
SPL_METHOD(Array, serialize)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
zval members, flags;
php_serialize_data_t var_hash;
@ -1704,7 +1704,7 @@ SPL_METHOD(Array, serialize)
*/
SPL_METHOD(Array, unserialize)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_array_object *intern = Z_SPLARRAY_P(object);
char *buf;

View File

@ -722,7 +722,7 @@ void spl_filesystem_object_construct(INTERNAL_FUNCTION_PARAMETERS, zend_long cto
return;
}
intern = Z_SPLFILESYSTEM_P(&EX(This));
intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (intern->_path) {
/* object is already initialized */
zend_restore_error_handling(&error_handling);
@ -760,7 +760,7 @@ SPL_METHOD(DirectoryIterator, __construct)
Rewind dir back to the start */
SPL_METHOD(DirectoryIterator, rewind)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -778,7 +778,7 @@ SPL_METHOD(DirectoryIterator, rewind)
Return current dir entry */
SPL_METHOD(DirectoryIterator, key)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -799,7 +799,7 @@ SPL_METHOD(DirectoryIterator, current)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
ZVAL_OBJ(return_value, Z_OBJ_P(&EX(This)));
ZVAL_OBJ(return_value, Z_OBJ_P(ZEND_THIS));
Z_ADDREF_P(return_value);
}
/* }}} */
@ -808,7 +808,7 @@ SPL_METHOD(DirectoryIterator, current)
Move to next entry */
SPL_METHOD(DirectoryIterator, next)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS);
if (zend_parse_parameters_none() == FAILURE) {
@ -830,7 +830,7 @@ SPL_METHOD(DirectoryIterator, next)
Seek to the given position */
SPL_METHOD(DirectoryIterator, seek)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zval retval;
zend_long pos;
@ -840,19 +840,19 @@ SPL_METHOD(DirectoryIterator, seek)
if (intern->u.dir.index > pos) {
/* we first rewind */
zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_rewind, "rewind", NULL);
zend_call_method_with_0_params(ZEND_THIS, Z_OBJCE_P(ZEND_THIS), &intern->u.dir.func_rewind, "rewind", NULL);
}
while (intern->u.dir.index < pos) {
int valid = 0;
zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_valid, "valid", &retval);
zend_call_method_with_0_params(ZEND_THIS, Z_OBJCE_P(ZEND_THIS), &intern->u.dir.func_valid, "valid", &retval);
valid = zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (!valid) {
zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0, "Seek position " ZEND_LONG_FMT " is out of range", pos);
return;
}
zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_next, "next", NULL);
zend_call_method_with_0_params(ZEND_THIS, Z_OBJCE_P(ZEND_THIS), &intern->u.dir.func_next, "next", NULL);
}
} /* }}} */
@ -860,7 +860,7 @@ SPL_METHOD(DirectoryIterator, seek)
Check whether dir contains more entries */
SPL_METHOD(DirectoryIterator, valid)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -874,7 +874,7 @@ SPL_METHOD(DirectoryIterator, valid)
Return the path */
SPL_METHOD(SplFileInfo, getPath)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char *path;
size_t path_len;
@ -891,7 +891,7 @@ SPL_METHOD(SplFileInfo, getPath)
Return filename only */
SPL_METHOD(SplFileInfo, getFilename)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
size_t path_len;
if (zend_parse_parameters_none() == FAILURE) {
@ -912,7 +912,7 @@ SPL_METHOD(SplFileInfo, getFilename)
Return filename of current dir entry */
SPL_METHOD(DirectoryIterator, getFilename)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -926,7 +926,7 @@ SPL_METHOD(DirectoryIterator, getFilename)
Returns file extension component of path */
SPL_METHOD(SplFileInfo, getExtension)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char *fname = NULL;
const char *p;
size_t flen;
@ -967,7 +967,7 @@ SPL_METHOD(SplFileInfo, getExtension)
Returns the file extension component of path */
SPL_METHOD(DirectoryIterator, getExtension)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
const char *p;
size_t idx;
zend_string *fname;
@ -994,7 +994,7 @@ SPL_METHOD(DirectoryIterator, getExtension)
Returns filename component of path */
SPL_METHOD(SplFileInfo, getBasename)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char *fname, *suffix = 0;
size_t flen;
size_t slen = 0, path_len;
@ -1021,7 +1021,7 @@ SPL_METHOD(SplFileInfo, getBasename)
Returns filename component of current dir entry */
SPL_METHOD(DirectoryIterator, getBasename)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char *suffix = 0;
size_t slen = 0;
zend_string *fname;
@ -1040,7 +1040,7 @@ SPL_METHOD(DirectoryIterator, getBasename)
Return path and filename */
SPL_METHOD(SplFileInfo, getPathname)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char *path;
size_t path_len;
@ -1060,7 +1060,7 @@ SPL_METHOD(SplFileInfo, getPathname)
Return getPathname() or getFilename() depending on flags */
SPL_METHOD(FilesystemIterator, key)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1079,7 +1079,7 @@ SPL_METHOD(FilesystemIterator, key)
Return getFilename(), getFileInfo() or $this depending on flags */
SPL_METHOD(FilesystemIterator, current)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1092,7 +1092,7 @@ SPL_METHOD(FilesystemIterator, current)
spl_filesystem_object_get_file_name(intern);
spl_filesystem_object_create_type(0, intern, SPL_FS_INFO, NULL, return_value);
} else {
ZVAL_OBJ(return_value, Z_OBJ_P(&EX(This)));
ZVAL_OBJ(return_value, Z_OBJ_P(ZEND_THIS));
Z_ADDREF_P(return_value);
/*RETURN_STRING(intern->u.dir.entry.d_name, 1);*/
}
@ -1103,7 +1103,7 @@ SPL_METHOD(FilesystemIterator, current)
Returns true if current entry is '.' or '..' */
SPL_METHOD(DirectoryIterator, isDot)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1128,7 +1128,7 @@ SPL_METHOD(SplFileInfo, __construct)
return;
}
intern = Z_SPLFILESYSTEM_P(&EX(This));
intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
spl_filesystem_info_set_filename(intern, path, len, 1);
@ -1140,7 +1140,7 @@ SPL_METHOD(SplFileInfo, __construct)
#define FileInfoFunction(func_name, func_num) \
SPL_METHOD(SplFileInfo, func_name) \
{ \
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This)); \
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); \
zend_error_handling error_handling; \
if (zend_parse_parameters_none() == FAILURE) { \
return; \
@ -1232,7 +1232,7 @@ FileInfoFunction(isLink, FS_IS_LINK)
Return the target of a symbolic link */
SPL_METHOD(SplFileInfo, getLinkTarget)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
ssize_t ret;
char buff[MAXPATHLEN];
zend_error_handling error_handling;
@ -1283,7 +1283,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
Return the resolved path */
SPL_METHOD(SplFileInfo, getRealPath)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char buff[MAXPATHLEN];
char *filename;
zend_error_handling error_handling;
@ -1325,7 +1325,7 @@ SPL_METHOD(SplFileInfo, getRealPath)
Open the current file */
SPL_METHOD(SplFileInfo, openFile)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
spl_filesystem_object_create_type(ZEND_NUM_ARGS(), intern, SPL_FS_FILE, NULL, return_value);
}
@ -1335,7 +1335,7 @@ SPL_METHOD(SplFileInfo, openFile)
Class to use in openFile() */
SPL_METHOD(SplFileInfo, setFileClass)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_class_entry *ce = spl_ce_SplFileObject;
zend_error_handling error_handling;
@ -1353,7 +1353,7 @@ SPL_METHOD(SplFileInfo, setFileClass)
Class to use in getFileInfo(), getPathInfo() */
SPL_METHOD(SplFileInfo, setInfoClass)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_class_entry *ce = spl_ce_SplFileInfo;
zend_error_handling error_handling;
@ -1371,7 +1371,7 @@ SPL_METHOD(SplFileInfo, setInfoClass)
Get/copy file info */
SPL_METHOD(SplFileInfo, getFileInfo)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_class_entry *ce = intern->info_class;
zend_error_handling error_handling;
@ -1389,7 +1389,7 @@ SPL_METHOD(SplFileInfo, getFileInfo)
Get/copy file info */
SPL_METHOD(SplFileInfo, getPathInfo)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_class_entry *ce = intern->info_class;
zend_error_handling error_handling;
@ -1431,7 +1431,7 @@ SPL_METHOD(FilesystemIterator, __construct)
Rewind dir back to the start */
SPL_METHOD(FilesystemIterator, rewind)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS);
if (zend_parse_parameters_none() == FAILURE) {
@ -1452,7 +1452,7 @@ SPL_METHOD(FilesystemIterator, rewind)
Get handling flags */
SPL_METHOD(FilesystemIterator, getFlags)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1465,7 +1465,7 @@ SPL_METHOD(FilesystemIterator, getFlags)
Set handling flags */
SPL_METHOD(FilesystemIterator, setFlags)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_long flags;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
@ -1481,7 +1481,7 @@ SPL_METHOD(FilesystemIterator, setFlags)
SPL_METHOD(RecursiveDirectoryIterator, hasChildren)
{
zend_bool allow_links = 0;
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &allow_links) == FAILURE) {
return;
@ -1506,7 +1506,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren)
SPL_METHOD(RecursiveDirectoryIterator, getChildren)
{
zval zpath, zflags;
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
spl_filesystem_object *subdir;
char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH;
@ -1518,7 +1518,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
ZVAL_LONG(&zflags, intern->flags);
ZVAL_STRINGL(&zpath, intern->file_name, intern->file_name_len);
spl_instantiate_arg_ex2(Z_OBJCE(EX(This)), return_value, &zpath, &zflags);
spl_instantiate_arg_ex2(Z_OBJCE_P(ZEND_THIS), return_value, &zpath, &zflags);
zval_ptr_dtor(&zpath);
subdir = Z_SPLFILESYSTEM_P(return_value);
@ -1540,7 +1540,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
Get sub path */
SPL_METHOD(RecursiveDirectoryIterator, getSubPath)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1558,7 +1558,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getSubPath)
Get sub path and file name */
SPL_METHOD(RecursiveDirectoryIterator, getSubPathname)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH;
if (zend_parse_parameters_none() == FAILURE) {
@ -1594,7 +1594,7 @@ SPL_METHOD(GlobIterator, __construct)
Return the number of directories and files found by globbing */
SPL_METHOD(GlobIterator, count)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2154,7 +2154,7 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL);
} else {
zend_execute_data *execute_data = EG(current_execute_data);
zend_call_method_with_0_params(this_ptr, Z_OBJCE(EX(This)), &intern->u.file.func_getCurr, "getCurrentLine", &retval);
zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(ZEND_THIS), &intern->u.file.func_getCurr, "getCurrentLine", &retval);
}
if (!Z_ISUNDEF(retval)) {
if (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) {
@ -2245,7 +2245,7 @@ static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *i
Construct a new file object */
SPL_METHOD(SplFileObject, __construct)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_bool use_include_path = 0;
char *p1, *p2;
char *tmp_path;
@ -2307,7 +2307,7 @@ SPL_METHOD(SplTempFileObject, __construct)
{
zend_long max_memory = PHP_STREAM_MAX_MEM;
char tmp_fname[48];
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_error_handling error_handling;
if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "|l", &max_memory) == FAILURE) {
@ -2339,20 +2339,20 @@ SPL_METHOD(SplTempFileObject, __construct)
Rewind the file and read the first line */
SPL_METHOD(SplFileObject, rewind)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
spl_filesystem_file_rewind(&EX(This), intern);
spl_filesystem_file_rewind(ZEND_THIS, intern);
} /* }}} */
/* {{{ proto void SplFileObject::eof()
Return whether end of file is reached */
SPL_METHOD(SplFileObject, eof)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2370,7 +2370,7 @@ SPL_METHOD(SplFileObject, eof)
Return !eof() */
SPL_METHOD(SplFileObject, valid)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2390,7 +2390,7 @@ SPL_METHOD(SplFileObject, valid)
Rturn next line from file */
SPL_METHOD(SplFileObject, fgets)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2411,7 +2411,7 @@ SPL_METHOD(SplFileObject, fgets)
Return current line from file */
SPL_METHOD(SplFileObject, current)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2423,7 +2423,7 @@ SPL_METHOD(SplFileObject, current)
}
if (!intern->u.file.current_line && Z_ISUNDEF(intern->u.file.current_zval)) {
spl_filesystem_file_read_line(&EX(This), intern, 1);
spl_filesystem_file_read_line(ZEND_THIS, intern, 1);
}
if (intern->u.file.current_line && (!SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || Z_ISUNDEF(intern->u.file.current_zval))) {
RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len);
@ -2440,7 +2440,7 @@ SPL_METHOD(SplFileObject, current)
Return line number */
SPL_METHOD(SplFileObject, key)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2448,7 +2448,7 @@ SPL_METHOD(SplFileObject, key)
/* Do not read the next line to support correct counting with fgetc()
if (!intern->current_line) {
spl_filesystem_file_read_line(&EX(This), intern, 1);
spl_filesystem_file_read_line(ZEND_THIS, intern, 1);
} */
RETURN_LONG(intern->u.file.current_line_num);
} /* }}} */
@ -2457,7 +2457,7 @@ SPL_METHOD(SplFileObject, key)
Read next line */
SPL_METHOD(SplFileObject, next)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2465,7 +2465,7 @@ SPL_METHOD(SplFileObject, next)
spl_filesystem_file_free_line(intern);
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) {
spl_filesystem_file_read_line(&EX(This), intern, 1);
spl_filesystem_file_read_line(ZEND_THIS, intern, 1);
}
intern->u.file.current_line_num++;
} /* }}} */
@ -2474,7 +2474,7 @@ SPL_METHOD(SplFileObject, next)
Set file handling flags */
SPL_METHOD(SplFileObject, setFlags)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) {
return;
@ -2485,7 +2485,7 @@ SPL_METHOD(SplFileObject, setFlags)
Get file handling flags */
SPL_METHOD(SplFileObject, getFlags)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2500,7 +2500,7 @@ SPL_METHOD(SplFileObject, setMaxLineLen)
{
zend_long max_len;
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &max_len) == FAILURE) {
return;
@ -2518,7 +2518,7 @@ SPL_METHOD(SplFileObject, setMaxLineLen)
Get maximum line length */
SPL_METHOD(SplFileObject, getMaxLineLen)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2552,7 +2552,7 @@ SPL_METHOD(SplFileObject, getChildren)
#define FileFunction(func_name) \
SPL_METHOD(SplFileObject, func_name) \
{ \
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This)); \
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS); \
FileFunctionCall(func_name, ZEND_NUM_ARGS(), NULL); \
}
/* }}} */
@ -2561,7 +2561,7 @@ SPL_METHOD(SplFileObject, func_name) \
Return current line as csv */
SPL_METHOD(SplFileObject, fgetcsv)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char delimiter = intern->u.file.delimiter, enclosure = intern->u.file.enclosure, escape = intern->u.file.escape;
char *delim = NULL, *enclo = NULL, *esc = NULL;
size_t d_len = 0, e_len = 0, esc_len = 0;
@ -2608,7 +2608,7 @@ SPL_METHOD(SplFileObject, fgetcsv)
Output a field array as a CSV line */
SPL_METHOD(SplFileObject, fputcsv)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char delimiter = intern->u.file.delimiter, enclosure = intern->u.file.enclosure, escape = intern->u.file.escape;
char *delim = NULL, *enclo = NULL, *esc = NULL;
size_t d_len = 0, e_len = 0, esc_len = 0;
@ -2653,7 +2653,7 @@ SPL_METHOD(SplFileObject, fputcsv)
Set the delimiter, enclosure and escape character used in fgetcsv */
SPL_METHOD(SplFileObject, setCsvControl)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char delimiter = ',', enclosure = '"', escape='\\';
char *delim = NULL, *enclo = NULL, *esc = NULL;
size_t d_len = 0, e_len = 0, esc_len = 0;
@ -2696,7 +2696,7 @@ SPL_METHOD(SplFileObject, setCsvControl)
Get the delimiter, enclosure and escape character used in fgetcsv */
SPL_METHOD(SplFileObject, getCsvControl)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char delimiter[2], enclosure[2], escape[2];
array_init(return_value);
@ -2723,7 +2723,7 @@ FileFunction(flock)
Flush the file */
SPL_METHOD(SplFileObject, fflush)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if(!intern->u.file.stream) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
@ -2737,7 +2737,7 @@ SPL_METHOD(SplFileObject, fflush)
Return current file position */
SPL_METHOD(SplFileObject, ftell)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_long ret;
if(!intern->u.file.stream) {
@ -2758,7 +2758,7 @@ SPL_METHOD(SplFileObject, ftell)
Return current file position */
SPL_METHOD(SplFileObject, fseek)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_long pos, whence = SEEK_SET;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &pos, &whence) == FAILURE) {
@ -2778,7 +2778,7 @@ SPL_METHOD(SplFileObject, fseek)
Get a character form the file */
SPL_METHOD(SplFileObject, fgetc)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char buf[2];
int result;
@ -2808,7 +2808,7 @@ SPL_METHOD(SplFileObject, fgetc)
Get a line from file pointer and strip HTML tags */
SPL_METHOD(SplFileObject, fgetss)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zval arg2;
if(!intern->u.file.stream) {
@ -2832,7 +2832,7 @@ SPL_METHOD(SplFileObject, fgetss)
Output all remaining data from a file pointer */
SPL_METHOD(SplFileObject, fpassthru)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if(!intern->u.file.stream) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
@ -2846,7 +2846,7 @@ SPL_METHOD(SplFileObject, fpassthru)
Implements a mostly ANSI compatible fscanf() */
SPL_METHOD(SplFileObject, fscanf)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
if(!intern->u.file.stream) {
zend_throw_exception_ex(spl_ce_RuntimeException, 0, "Object not initialized");
@ -2864,7 +2864,7 @@ SPL_METHOD(SplFileObject, fscanf)
Binary-safe file write */
SPL_METHOD(SplFileObject, fwrite)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
char *str;
size_t str_len;
zend_long length = 0;
@ -2895,7 +2895,7 @@ SPL_METHOD(SplFileObject, fwrite)
SPL_METHOD(SplFileObject, fread)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_long length = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
@ -2928,7 +2928,7 @@ FileFunction(fstat)
Truncate file to 'size' length */
SPL_METHOD(SplFileObject, ftruncate)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_long size;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &size) == FAILURE) {
@ -2952,7 +2952,7 @@ SPL_METHOD(SplFileObject, ftruncate)
Seek to specified line */
SPL_METHOD(SplFileObject, seek)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(&EX(This));
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(ZEND_THIS);
zend_long line_pos;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &line_pos) == FAILURE) {
@ -2968,10 +2968,10 @@ SPL_METHOD(SplFileObject, seek)
RETURN_FALSE;
}
spl_filesystem_file_rewind(&EX(This), intern);
spl_filesystem_file_rewind(ZEND_THIS, intern);
while(intern->u.file.current_line_num < line_pos) {
if (spl_filesystem_file_read_line(&EX(This), intern, 1) == FAILURE) {
if (spl_filesystem_file_read_line(ZEND_THIS, intern, 1) == FAILURE) {
break;
}
}

View File

@ -567,7 +567,7 @@ SPL_METHOD(SplDoublyLinkedList, push)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
spl_ptr_llist_push(intern->llist, value);
RETURN_TRUE;
@ -585,7 +585,7 @@ SPL_METHOD(SplDoublyLinkedList, unshift)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
spl_ptr_llist_unshift(intern->llist, value);
RETURN_TRUE;
@ -602,7 +602,7 @@ SPL_METHOD(SplDoublyLinkedList, pop)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
spl_ptr_llist_pop(intern->llist, return_value);
if (Z_ISUNDEF_P(return_value)) {
@ -622,7 +622,7 @@ SPL_METHOD(SplDoublyLinkedList, shift)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
spl_ptr_llist_shift(intern->llist, return_value);
if (Z_ISUNDEF_P(return_value)) {
@ -643,7 +643,7 @@ SPL_METHOD(SplDoublyLinkedList, top)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
value = spl_ptr_llist_last(intern->llist);
if (value == NULL || Z_ISUNDEF_P(value)) {
@ -666,7 +666,7 @@ SPL_METHOD(SplDoublyLinkedList, bottom)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
value = spl_ptr_llist_first(intern->llist);
if (value == NULL || Z_ISUNDEF_P(value)) {
@ -683,7 +683,7 @@ SPL_METHOD(SplDoublyLinkedList, bottom)
SPL_METHOD(SplDoublyLinkedList, count)
{
zend_long count;
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -704,7 +704,7 @@ SPL_METHOD(SplDoublyLinkedList, isEmpty)
return;
}
spl_dllist_object_count_elements(&EX(This), &count);
spl_dllist_object_count_elements(ZEND_THIS, &count);
RETURN_BOOL(count == 0);
}
/* }}} */
@ -720,7 +720,7 @@ SPL_METHOD(SplDoublyLinkedList, setIteratorMode)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
if (intern->flags & SPL_DLLIST_IT_FIX
&& (intern->flags & SPL_DLLIST_IT_LIFO) != (value & SPL_DLLIST_IT_LIFO)) {
@ -744,7 +744,7 @@ SPL_METHOD(SplDoublyLinkedList, getIteratorMode)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
RETURN_LONG(intern->flags);
}
@ -762,7 +762,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetExists)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
index = spl_offset_convert_to_long(zindex);
RETURN_BOOL(index >= 0 && index < intern->llist->count);
@ -781,7 +781,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
index = spl_offset_convert_to_long(zindex);
if (index < 0 || index >= intern->llist->count) {
@ -811,7 +811,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetSet)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
if (Z_TYPE_P(zindex) == IS_NULL) {
/* $obj[] = ... */
@ -867,7 +867,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
index = spl_offset_convert_to_long(zindex);
llist = intern->llist;
@ -1034,7 +1034,7 @@ static void spl_dllist_it_move_forward(zend_object_iterator *iter) /* {{{ */
Return current array key */
SPL_METHOD(SplDoublyLinkedList, key)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1048,7 +1048,7 @@ SPL_METHOD(SplDoublyLinkedList, key)
Move to next entry */
SPL_METHOD(SplDoublyLinkedList, prev)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1062,7 +1062,7 @@ SPL_METHOD(SplDoublyLinkedList, prev)
Move to next entry */
SPL_METHOD(SplDoublyLinkedList, next)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1076,7 +1076,7 @@ SPL_METHOD(SplDoublyLinkedList, next)
Check whether the datastructure contains more entries */
SPL_METHOD(SplDoublyLinkedList, valid)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1090,7 +1090,7 @@ SPL_METHOD(SplDoublyLinkedList, valid)
Rewind the datastructure back to the start */
SPL_METHOD(SplDoublyLinkedList, rewind)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1104,7 +1104,7 @@ SPL_METHOD(SplDoublyLinkedList, rewind)
Return current datastructure entry */
SPL_METHOD(SplDoublyLinkedList, current)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
spl_ptr_llist_element *element = intern->traverse_pointer;
if (zend_parse_parameters_none() == FAILURE) {
@ -1125,7 +1125,7 @@ SPL_METHOD(SplDoublyLinkedList, current)
Serializes storage */
SPL_METHOD(SplDoublyLinkedList, serialize)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
smart_str buf = {0};
spl_ptr_llist_element *current = intern->llist->head, *next;
zval flags;
@ -1168,7 +1168,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize)
Unserializes storage */
SPL_METHOD(SplDoublyLinkedList, unserialize)
{
spl_dllist_object *intern = Z_SPLDLLIST_P(&EX(This));
spl_dllist_object *intern = Z_SPLDLLIST_P(ZEND_THIS);
zval *flags, *elem;
char *buf;
size_t buf_len;
@ -1233,7 +1233,7 @@ SPL_METHOD(SplDoublyLinkedList, add)
return;
}
intern = Z_SPLDLLIST_P(&EX(This));
intern = Z_SPLDLLIST_P(ZEND_THIS);
index = spl_offset_convert_to_long(zindex);
if (index < 0 || index > intern->llist->count) {

View File

@ -548,7 +548,7 @@ static int spl_fixedarray_object_count_elements(zval *object, zend_long *count)
*/
SPL_METHOD(SplFixedArray, __construct)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_fixedarray_object *intern;
zend_long size = 0;
@ -576,8 +576,8 @@ SPL_METHOD(SplFixedArray, __construct)
*/
SPL_METHOD(SplFixedArray, __wakeup)
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(&EX(This));
HashTable *intern_ht = zend_std_get_properties(&EX(This));
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
HashTable *intern_ht = zend_std_get_properties(ZEND_THIS);
zval *data;
if (zend_parse_parameters_none() == FAILURE) {
@ -606,7 +606,7 @@ SPL_METHOD(SplFixedArray, __wakeup)
*/
SPL_METHOD(SplFixedArray, count)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_fixedarray_object *intern;
if (zend_parse_parameters_none() == FAILURE) {
@ -628,7 +628,7 @@ SPL_METHOD(SplFixedArray, toArray)
return;
}
intern = Z_SPLFIXEDARRAY_P(&EX(This));
intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
if (intern->array.size > 0) {
int i = 0;
@ -717,7 +717,7 @@ SPL_METHOD(SplFixedArray, fromArray)
*/
SPL_METHOD(SplFixedArray, getSize)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_fixedarray_object *intern;
if (zend_parse_parameters_none() == FAILURE) {
@ -733,7 +733,7 @@ SPL_METHOD(SplFixedArray, getSize)
*/
SPL_METHOD(SplFixedArray, setSize)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_fixedarray_object *intern;
zend_long size;
@ -764,7 +764,7 @@ SPL_METHOD(SplFixedArray, offsetExists)
return;
}
intern = Z_SPLFIXEDARRAY_P(&EX(This));
intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
RETURN_BOOL(spl_fixedarray_object_has_dimension_helper(intern, zindex, 0));
} /* }}} */
@ -780,7 +780,7 @@ SPL_METHOD(SplFixedArray, offsetGet)
return;
}
intern = Z_SPLFIXEDARRAY_P(&EX(This));
intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
value = spl_fixedarray_object_read_dimension_helper(intern, zindex);
if (value) {
@ -801,7 +801,7 @@ SPL_METHOD(SplFixedArray, offsetSet)
return;
}
intern = Z_SPLFIXEDARRAY_P(&EX(This));
intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
spl_fixedarray_object_write_dimension_helper(intern, zindex, value);
} /* }}} */
@ -817,7 +817,7 @@ SPL_METHOD(SplFixedArray, offsetUnset)
return;
}
intern = Z_SPLFIXEDARRAY_P(&EX(This));
intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
spl_fixedarray_object_unset_dimension_helper(intern, zindex);
} /* }}} */
@ -910,7 +910,7 @@ static void spl_fixedarray_it_move_forward(zend_object_iterator *iter) /* {{{ */
Return current array key */
SPL_METHOD(SplFixedArray, key)
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(&EX(This));
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -924,7 +924,7 @@ SPL_METHOD(SplFixedArray, key)
Move to next entry */
SPL_METHOD(SplFixedArray, next)
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(&EX(This));
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -938,7 +938,7 @@ SPL_METHOD(SplFixedArray, next)
Check whether the datastructure contains more entries */
SPL_METHOD(SplFixedArray, valid)
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(&EX(This));
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -952,7 +952,7 @@ SPL_METHOD(SplFixedArray, valid)
Rewind the datastructure back to the start */
SPL_METHOD(SplFixedArray, rewind)
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(&EX(This));
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -967,7 +967,7 @@ SPL_METHOD(SplFixedArray, rewind)
SPL_METHOD(SplFixedArray, current)
{
zval zindex, *value;
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(&EX(This));
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;

View File

@ -543,7 +543,7 @@ static HashTable* spl_pqueue_object_get_debug_info(zval *obj, int *is_temp) /* {
SPL_METHOD(SplHeap, count)
{
zend_long count;
spl_heap_object *intern = Z_SPLHEAP_P(&EX(This));
spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -558,7 +558,7 @@ SPL_METHOD(SplHeap, count)
Return true if the heap is empty. */
SPL_METHOD(SplHeap, isEmpty)
{
spl_heap_object *intern = Z_SPLHEAP_P(&EX(This));
spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -579,7 +579,7 @@ SPL_METHOD(SplHeap, insert)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
@ -587,7 +587,7 @@ SPL_METHOD(SplHeap, insert)
}
Z_TRY_ADDREF_P(value);
spl_ptr_heap_insert(intern->heap, value, &EX(This));
spl_ptr_heap_insert(intern->heap, value, ZEND_THIS);
RETURN_TRUE;
}
@ -603,14 +603,14 @@ SPL_METHOD(SplHeap, extract)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
spl_ptr_heap_delete_top(intern->heap, return_value, &EX(This));
spl_ptr_heap_delete_top(intern->heap, return_value, ZEND_THIS);
if (Z_ISUNDEF_P(return_value)) {
zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0);
@ -630,7 +630,7 @@ SPL_METHOD(SplPriorityQueue, insert)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
@ -644,7 +644,7 @@ SPL_METHOD(SplPriorityQueue, insert)
add_assoc_zval_ex(&elem, "data", sizeof("data") - 1, data);
add_assoc_zval_ex(&elem, "priority", sizeof("priority") - 1, priority);
spl_ptr_heap_insert(intern->heap, &elem, &EX(This));
spl_ptr_heap_insert(intern->heap, &elem, ZEND_THIS);
RETURN_TRUE;
}
@ -661,14 +661,14 @@ SPL_METHOD(SplPriorityQueue, extract)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
return;
}
spl_ptr_heap_delete_top(intern->heap, &value, &EX(This));
spl_ptr_heap_delete_top(intern->heap, &value, ZEND_THIS);
if (Z_ISUNDEF(value)) {
zend_throw_exception(spl_ce_RuntimeException, "Can't extract from an empty heap", 0);
@ -699,7 +699,7 @@ SPL_METHOD(SplPriorityQueue, top)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
@ -736,7 +736,7 @@ SPL_METHOD(SplPriorityQueue, setExtractFlags)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
intern->flags = value & SPL_PQUEUE_EXTR_MASK;
@ -754,7 +754,7 @@ SPL_METHOD(SplPriorityQueue, getExtractFlags)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
RETURN_LONG(intern->flags);
}
@ -770,7 +770,7 @@ SPL_METHOD(SplHeap, recoverFromCorruption)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
intern->heap->flags = intern->heap->flags & ~SPL_HEAP_CORRUPTED;
@ -788,7 +788,7 @@ SPL_METHOD(SplHeap, isCorrupted)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
RETURN_BOOL(intern->heap->flags & SPL_HEAP_CORRUPTED);
}
@ -819,7 +819,7 @@ SPL_METHOD(SplHeap, top)
return;
}
intern = Z_SPLHEAP_P(&EX(This));
intern = Z_SPLHEAP_P(ZEND_THIS);
if (intern->heap->flags & SPL_HEAP_CORRUPTED) {
zend_throw_exception(spl_ce_RuntimeException, "Heap is corrupted, heap properties are no longer ensured.", 0);
@ -956,7 +956,7 @@ static void spl_heap_it_move_forward(zend_object_iterator *iter) /* {{{ */
Return current array key */
SPL_METHOD(SplHeap, key)
{
spl_heap_object *intern = Z_SPLHEAP_P(&EX(This));
spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -970,9 +970,9 @@ SPL_METHOD(SplHeap, key)
Move to next entry */
SPL_METHOD(SplHeap, next)
{
spl_heap_object *intern = Z_SPLHEAP_P(&EX(This));
spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS);
zval elem;
spl_ptr_heap_delete_top(intern->heap, &elem, &EX(This));
spl_ptr_heap_delete_top(intern->heap, &elem, ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -986,7 +986,7 @@ SPL_METHOD(SplHeap, next)
Check whether the datastructure contains more entries */
SPL_METHOD(SplHeap, valid)
{
spl_heap_object *intern = Z_SPLHEAP_P(&EX(This));
spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1011,7 +1011,7 @@ SPL_METHOD(SplHeap, rewind)
Return current datastructure entry */
SPL_METHOD(SplHeap, current)
{
spl_heap_object *intern = Z_SPLHEAP_P(&EX(This));
spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS);
zval *element = &intern->heap->elements[0];
if (zend_parse_parameters_none() == FAILURE) {
@ -1030,7 +1030,7 @@ SPL_METHOD(SplHeap, current)
Return current datastructure entry */
SPL_METHOD(SplPriorityQueue, current)
{
spl_heap_object *intern = Z_SPLHEAP_P(&EX(This));
spl_heap_object *intern = Z_SPLHEAP_P(ZEND_THIS);
zval *element = &intern->heap->elements[0];
if (zend_parse_parameters_none() == FAILURE) {

View File

@ -476,7 +476,7 @@ static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce,
static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *ce_base, zend_class_entry *ce_inner, recursive_it_it_type rit_type)
{
zval *object = &EX(This);
zval *object = ZEND_THIS;
spl_recursive_it_object *intern;
zval *iterator;
zend_class_entry *ce_iterator;
@ -612,33 +612,33 @@ SPL_METHOD(RecursiveIteratorIterator, __construct)
Rewind the iterator to the first element of the top level inner iterator. */
SPL_METHOD(RecursiveIteratorIterator, rewind)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
spl_recursive_it_rewind_ex(object, &EX(This));
spl_recursive_it_rewind_ex(object, ZEND_THIS);
} /* }}} */
/* {{{ proto bool RecursiveIteratorIterator::valid()
Check whether the current position is valid */
SPL_METHOD(RecursiveIteratorIterator, valid)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_BOOL(spl_recursive_it_valid_ex(object, &EX(This)) == SUCCESS);
RETURN_BOOL(spl_recursive_it_valid_ex(object, ZEND_THIS) == SUCCESS);
} /* }}} */
/* {{{ proto mixed RecursiveIteratorIterator::key()
Access the current key */
SPL_METHOD(RecursiveIteratorIterator, key)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_object_iterator *iterator;
if (zend_parse_parameters_none() == FAILURE) {
@ -658,7 +658,7 @@ SPL_METHOD(RecursiveIteratorIterator, key)
Access the current element value */
SPL_METHOD(RecursiveIteratorIterator, current)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_object_iterator *iterator;
zval *data;
@ -678,20 +678,20 @@ SPL_METHOD(RecursiveIteratorIterator, current)
Move forward to the next element */
SPL_METHOD(RecursiveIteratorIterator, next)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
spl_recursive_it_move_forward_ex(object, &EX(This));
spl_recursive_it_move_forward_ex(object, ZEND_THIS);
} /* }}} */
/* {{{ proto int RecursiveIteratorIterator::getDepth()
Get the current depth of the recursive iteration */
SPL_METHOD(RecursiveIteratorIterator, getDepth)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -704,7 +704,7 @@ SPL_METHOD(RecursiveIteratorIterator, getDepth)
The current active sub iterator or the iterator at specified level */
SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_long level = object->level;
zval *value;
@ -729,7 +729,7 @@ SPL_METHOD(RecursiveIteratorIterator, getSubIterator)
The current active sub iterator */
SPL_METHOD(RecursiveIteratorIterator, getInnerIterator)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zval *zobject;
if (zend_parse_parameters_none() == FAILURE) {
@ -765,7 +765,7 @@ SPL_METHOD(RecursiveIteratorIterator, endIteration)
Called for each element to test whether it has children */
SPL_METHOD(RecursiveIteratorIterator, callHasChildren)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_class_entry *ce;
zval *zobject;
@ -794,7 +794,7 @@ SPL_METHOD(RecursiveIteratorIterator, callHasChildren)
Return children of current element */
SPL_METHOD(RecursiveIteratorIterator, callGetChildren)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_class_entry *ce;
zval *zobject;
@ -849,7 +849,7 @@ SPL_METHOD(RecursiveIteratorIterator, nextElement)
Set the maximum allowed depth (or any depth if pmax_depth = -1] */
SPL_METHOD(RecursiveIteratorIterator, setMaxDepth)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_long max_depth = -1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &max_depth) == FAILURE) {
@ -869,7 +869,7 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth)
Return the maximum accepted depth or false if any depth is allowed */
SPL_METHOD(RecursiveIteratorIterator, getMaxDepth)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1104,7 +1104,7 @@ SPL_METHOD(RecursiveTreeIterator, setPrefixPart)
zend_long part;
char* prefix;
size_t prefix_len;
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &part, &prefix, &prefix_len) == FAILURE) {
return;
@ -1123,7 +1123,7 @@ SPL_METHOD(RecursiveTreeIterator, setPrefixPart)
Returns the string to place in front of current element */
SPL_METHOD(RecursiveTreeIterator, getPrefix)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1142,7 +1142,7 @@ SPL_METHOD(RecursiveTreeIterator, getPrefix)
Sets postfix as used in getPostfix() */
SPL_METHOD(RecursiveTreeIterator, setPostfix)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
char* postfix;
size_t postfix_len;
@ -1158,7 +1158,7 @@ SPL_METHOD(RecursiveTreeIterator, setPostfix)
Returns the string presentation built for current element */
SPL_METHOD(RecursiveTreeIterator, getEntry)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1177,7 +1177,7 @@ SPL_METHOD(RecursiveTreeIterator, getEntry)
Returns the string to place after the current element */
SPL_METHOD(RecursiveTreeIterator, getPostfix)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1196,7 +1196,7 @@ SPL_METHOD(RecursiveTreeIterator, getPostfix)
Returns the current element prefixed and postfixed */
SPL_METHOD(RecursiveTreeIterator, current)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zval prefix, entry, postfix;
char *ptr;
zend_string *str;
@ -1258,7 +1258,7 @@ SPL_METHOD(RecursiveTreeIterator, current)
Returns the current key prefixed and postfixed */
SPL_METHOD(RecursiveTreeIterator, key)
{
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(&EX(This));
spl_recursive_it_object *object = Z_SPLRECURSIVE_IT_P(ZEND_THIS);
zend_object_iterator *iterator;
zval prefix, key, postfix, key_copy;
char *ptr;
@ -1378,7 +1378,7 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
void **p;
spl_dual_it_object *intern;
intern = Z_SPLDUAL_IT_P(&EX(This));
intern = Z_SPLDUAL_IT_P(ZEND_THIS);
ZVAL_STRING(&func, method, 0);
@ -1439,7 +1439,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
int inc_refcount = 1;
zend_error_handling error_handling;
intern = Z_SPLDUAL_IT_P(&EX(This));
intern = Z_SPLDUAL_IT_P(ZEND_THIS);
if (intern->dit_type != DIT_Unknown) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s::getIterator() must be called exactly once per instance", ZSTR_VAL(ce_base->name));
@ -1612,7 +1612,7 @@ SPL_METHOD(dual_it, getInnerIterator)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!Z_ISUNDEF(intern->inner.zobject)) {
zval *value = &intern->inner.zobject;
@ -1715,7 +1715,7 @@ SPL_METHOD(dual_it, rewind)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_dual_it_rewind(intern);
spl_dual_it_fetch(intern, 1);
@ -1734,7 +1734,7 @@ SPL_METHOD(dual_it, valid)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_BOOL(Z_TYPE(intern->current.data) != IS_UNDEF);
} /* }}} */
@ -1755,7 +1755,7 @@ SPL_METHOD(dual_it, key)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (Z_TYPE(intern->current.key) != IS_UNDEF) {
zval *value = &intern->current.key;
@ -1781,7 +1781,7 @@ SPL_METHOD(dual_it, current)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (Z_TYPE(intern->current.data) != IS_UNDEF) {
zval *value = &intern->current.data;
@ -1804,7 +1804,7 @@ SPL_METHOD(dual_it, next)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_dual_it_next(intern, 1);
spl_dual_it_fetch(intern, 1);
@ -1853,8 +1853,8 @@ SPL_METHOD(FilterIterator, rewind)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
spl_filter_it_rewind(&EX(This), intern);
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_filter_it_rewind(ZEND_THIS, intern);
} /* }}} */
/* {{{ proto void FilterIterator::next()
@ -1867,8 +1867,8 @@ SPL_METHOD(FilterIterator, next)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
spl_filter_it_next(&EX(This), intern);
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_filter_it_next(ZEND_THIS, intern);
} /* }}} */
/* {{{ proto RecursiveCallbackFilterIterator::__construct(RecursiveIterator it, callback func)
@ -1897,7 +1897,7 @@ SPL_METHOD(RecursiveFilterIterator, hasChildren)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "haschildren", &retval);
if (Z_TYPE(retval) != IS_UNDEF) {
@ -1918,11 +1918,11 @@ SPL_METHOD(RecursiveFilterIterator, getChildren)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) {
spl_instantiate_arg_ex1(Z_OBJCE(EX(This)), return_value, &retval);
spl_instantiate_arg_ex1(Z_OBJCE_P(ZEND_THIS), return_value, &retval);
}
zval_ptr_dtor(&retval);
} /* }}} */
@ -1938,11 +1938,11 @@ SPL_METHOD(RecursiveCallbackFilterIterator, getChildren)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception) && Z_TYPE(retval) != IS_UNDEF) {
spl_instantiate_arg_ex2(Z_OBJCE(EX(This)), return_value, &retval, &intern->u.cbfilter->fci.function_name);
spl_instantiate_arg_ex2(Z_OBJCE_P(ZEND_THIS), return_value, &retval, &intern->u.cbfilter->fci.function_name);
}
zval_ptr_dtor(&retval);
} /* }}} */
@ -1965,7 +1965,7 @@ SPL_METHOD(RegexIterator, __construct)
Calls the callback with the current value, the current key and the inner iterator as arguments */
SPL_METHOD(CallbackFilterIterator, accept)
{
spl_dual_it_object *intern = Z_SPLDUAL_IT_P(&EX(This));
spl_dual_it_object *intern = Z_SPLDUAL_IT_P(ZEND_THIS);
zend_fcall_info *fci = &intern->u.cbfilter->fci;
zend_fcall_info_cache *fcc = &intern->u.cbfilter->fcc;
zval params[3];
@ -2017,7 +2017,7 @@ SPL_METHOD(RegexIterator, accept)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (Z_TYPE(intern->current.data) == IS_UNDEF) {
RETURN_FALSE;
@ -2064,7 +2064,7 @@ SPL_METHOD(RegexIterator, accept)
break;
case REGIT_MODE_REPLACE:
replacement = zend_read_property(intern->std.ce, &EX(This), "replacement", sizeof("replacement")-1, 1, &rv);
replacement = zend_read_property(intern->std.ce, ZEND_THIS, "replacement", sizeof("replacement")-1, 1, &rv);
if (Z_TYPE_P(replacement) != IS_STRING) {
ZVAL_COPY(&tmp_replacement, replacement);
convert_to_string(&tmp_replacement);
@ -2096,7 +2096,7 @@ SPL_METHOD(RegexIterator, accept)
Returns current regular expression */
SPL_METHOD(RegexIterator, getRegex)
{
spl_dual_it_object *intern = Z_SPLDUAL_IT_P(&EX(This));
spl_dual_it_object *intern = Z_SPLDUAL_IT_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -2115,7 +2115,7 @@ SPL_METHOD(RegexIterator, getMode)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_LONG(intern->u.regex.mode);
} /* }}} */
@ -2136,7 +2136,7 @@ SPL_METHOD(RegexIterator, setMode)
return;/* NULL */
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
intern->u.regex.mode = mode;
} /* }}} */
@ -2151,7 +2151,7 @@ SPL_METHOD(RegexIterator, getFlags)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_LONG(intern->u.regex.flags);
} /* }}} */
@ -2167,7 +2167,7 @@ SPL_METHOD(RegexIterator, setFlags)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
intern->u.regex.flags = flags;
} /* }}} */
@ -2182,7 +2182,7 @@ SPL_METHOD(RegexIterator, getPregFlags)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (intern->u.regex.use_flags) {
RETURN_LONG(intern->u.regex.preg_flags);
@ -2202,7 +2202,7 @@ SPL_METHOD(RegexIterator, setPregFlags)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
intern->u.regex.preg_flags = preg_flags;
intern->u.regex.use_flags = 1;
@ -2226,7 +2226,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception)) {
@ -2238,7 +2238,7 @@ SPL_METHOD(RecursiveRegexIterator, getChildren)
ZVAL_LONG(&args[3], intern->u.regex.flags);
ZVAL_LONG(&args[4], intern->u.regex.preg_flags);
spl_instantiate_arg_n(Z_OBJCE(EX(This)), return_value, 5, args);
spl_instantiate_arg_n(Z_OBJCE_P(ZEND_THIS), return_value, 5, args);
zval_ptr_dtor(&args[0]);
zval_ptr_dtor(&args[1]);
@ -2254,7 +2254,7 @@ SPL_METHOD(RecursiveRegexIterator, accept)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (Z_TYPE(intern->current.data) == IS_UNDEF) {
RETURN_FALSE;
@ -2262,7 +2262,7 @@ SPL_METHOD(RecursiveRegexIterator, accept)
RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL(intern->current.data)) > 0);
}
zend_call_method_with_0_params(&EX(This), spl_ce_RegexIterator, NULL, "accept", return_value);
zend_call_method_with_0_params(ZEND_THIS, spl_ce_RegexIterator, NULL, "accept", return_value);
}
#endif
@ -2515,7 +2515,7 @@ SPL_METHOD(LimitIterator, rewind)
{
spl_dual_it_object *intern;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_dual_it_rewind(intern);
spl_limit_it_seek(intern, intern->u.limit.offset);
} /* }}} */
@ -2526,7 +2526,7 @@ SPL_METHOD(LimitIterator, valid)
{
spl_dual_it_object *intern;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
/* RETURN_BOOL(spl_limit_it_valid(intern) == SUCCESS);*/
RETURN_BOOL((intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) && Z_TYPE(intern->current.data) != IS_UNDEF);
@ -2538,7 +2538,7 @@ SPL_METHOD(LimitIterator, next)
{
spl_dual_it_object *intern;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_dual_it_next(intern, 1);
if (intern->u.limit.count == -1 || intern->current.pos < intern->u.limit.offset + intern->u.limit.count) {
@ -2557,7 +2557,7 @@ SPL_METHOD(LimitIterator, seek)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_limit_it_seek(intern, pos);
RETURN_LONG(intern->current.pos);
} /* }}} */
@ -2567,7 +2567,7 @@ SPL_METHOD(LimitIterator, seek)
SPL_METHOD(LimitIterator, getPosition)
{
spl_dual_it_object *intern;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_LONG(intern->current.pos);
} /* }}} */
@ -2710,7 +2710,7 @@ SPL_METHOD(CachingIterator, rewind)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_caching_it_rewind(intern);
} /* }}} */
@ -2725,7 +2725,7 @@ SPL_METHOD(CachingIterator, valid)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_BOOL(spl_caching_it_valid(intern) == SUCCESS);
} /* }}} */
@ -2740,7 +2740,7 @@ SPL_METHOD(CachingIterator, next)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_caching_it_next(intern);
} /* }}} */
@ -2755,7 +2755,7 @@ SPL_METHOD(CachingIterator, hasNext)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_BOOL(spl_caching_it_has_next(intern) == SUCCESS);
} /* }}} */
@ -2766,10 +2766,10 @@ SPL_METHOD(CachingIterator, __toString)
{
spl_dual_it_object *intern;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & (CIT_CALL_TOSTRING|CIT_TOSTRING_USE_KEY|CIT_TOSTRING_USE_CURRENT|CIT_TOSTRING_USE_INNER))) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not fetch string value (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE(EX(This))->name));
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not fetch string value (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
if (intern->u.caching.flags & CIT_TOSTRING_USE_KEY) {
@ -2796,10 +2796,10 @@ SPL_METHOD(CachingIterator, offsetSet)
zend_string *key;
zval *value;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE(EX(This))->name));
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
@ -2820,10 +2820,10 @@ SPL_METHOD(CachingIterator, offsetGet)
zend_string *key;
zval *value;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE(EX(This))->name));
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
@ -2847,10 +2847,10 @@ SPL_METHOD(CachingIterator, offsetUnset)
spl_dual_it_object *intern;
zend_string *key;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE(EX(This))->name));
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
@ -2869,10 +2869,10 @@ SPL_METHOD(CachingIterator, offsetExists)
spl_dual_it_object *intern;
zend_string *key;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE(EX(This))->name));
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
@ -2894,10 +2894,10 @@ SPL_METHOD(CachingIterator, getCache)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE(EX(This))->name));
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
@ -2915,7 +2915,7 @@ SPL_METHOD(CachingIterator, getFlags)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_LONG(intern->u.caching.flags);
}
@ -2928,7 +2928,7 @@ SPL_METHOD(CachingIterator, setFlags)
spl_dual_it_object *intern;
zend_long flags;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &flags) == FAILURE) {
return;
@ -2964,10 +2964,10 @@ SPL_METHOD(CachingIterator, count)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (!(intern->u.caching.flags & CIT_FULL_CACHE)) {
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE(EX(This))->name));
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "%s does not use a full cache (see CachingIterator::__construct)", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
return;
}
@ -3031,7 +3031,7 @@ SPL_METHOD(RecursiveCachingIterator, hasChildren)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_BOOL(Z_TYPE(intern->u.caching.zchildren) != IS_UNDEF);
} /* }}} */
@ -3046,7 +3046,7 @@ SPL_METHOD(RecursiveCachingIterator, getChildren)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (Z_TYPE(intern->u.caching.zchildren) != IS_UNDEF) {
zval *value = &intern->u.caching.zchildren;
@ -3118,7 +3118,7 @@ SPL_METHOD(NoRewindIterator, valid)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_BOOL(intern->inner.iterator->funcs->valid(intern->inner.iterator) == SUCCESS);
} /* }}} */
@ -3132,7 +3132,7 @@ SPL_METHOD(NoRewindIterator, key)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (intern->inner.iterator->funcs->get_current_key) {
intern->inner.iterator->funcs->get_current_key(intern->inner.iterator, return_value);
@ -3152,7 +3152,7 @@ SPL_METHOD(NoRewindIterator, current)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
data = intern->inner.iterator->funcs->get_current_data(intern->inner.iterator);
if (data) {
ZVAL_COPY_DEREF(return_value, data);
@ -3169,7 +3169,7 @@ SPL_METHOD(NoRewindIterator, next)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
intern->inner.iterator->funcs->move_forward(intern->inner.iterator);
} /* }}} */
@ -3205,7 +3205,7 @@ SPL_METHOD(InfiniteIterator, next)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_dual_it_next(intern, 1);
if (spl_dual_it_valid(intern) == SUCCESS) {
@ -3341,7 +3341,7 @@ SPL_METHOD(AppendIterator, append)
spl_dual_it_object *intern;
zval *it;
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "O", &it, zend_ce_iterator) == FAILURE) {
return;
@ -3374,7 +3374,7 @@ SPL_METHOD(AppendIterator, current)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_dual_it_fetch(intern, 1);
if (Z_TYPE(intern->current.data) != IS_UNDEF) {
@ -3396,7 +3396,7 @@ SPL_METHOD(AppendIterator, rewind)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
intern->u.append.iterator->funcs->rewind(intern->u.append.iterator);
if (spl_append_it_next_iterator(intern) == SUCCESS) {
@ -3414,7 +3414,7 @@ SPL_METHOD(AppendIterator, valid)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
RETURN_BOOL(Z_TYPE(intern->current.data) != IS_UNDEF);
} /* }}} */
@ -3429,7 +3429,7 @@ SPL_METHOD(AppendIterator, next)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
spl_append_it_next(intern);
} /* }}} */
@ -3444,7 +3444,7 @@ SPL_METHOD(AppendIterator, getIteratorIndex)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
APPENDIT_CHECK_CTOR(intern);
spl_array_iterator_key(&intern->u.append.zarrayit, return_value);
@ -3461,7 +3461,7 @@ SPL_METHOD(AppendIterator, getArrayIterator)
return;
}
SPL_FETCH_AND_CHECK_DUAL_IT(intern, &EX(This));
SPL_FETCH_AND_CHECK_DUAL_IT(intern, ZEND_THIS);
value = &intern->u.append.zarrayit;
ZVAL_COPY_DEREF(return_value, value);

View File

@ -399,12 +399,12 @@ SPL_METHOD(SplObjectStorage, attach)
{
zval *obj, *inf = NULL;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|z!", &obj, &inf) == FAILURE) {
return;
}
spl_object_storage_attach(intern, &EX(This), obj, inf);
spl_object_storage_attach(intern, ZEND_THIS, obj, inf);
} /* }}} */
/* {{{ proto void SplObjectStorage::detach(object obj)
@ -412,12 +412,12 @@ SPL_METHOD(SplObjectStorage, attach)
SPL_METHOD(SplObjectStorage, detach)
{
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
spl_object_storage_detach(intern, &EX(This), obj);
spl_object_storage_detach(intern, ZEND_THIS, obj);
zend_hash_internal_pointer_reset_ex(&intern->storage, &intern->pos);
intern->index = 0;
@ -443,14 +443,14 @@ SPL_METHOD(SplObjectStorage, offsetGet)
{
zval *obj;
spl_SplObjectStorageElement *element;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
zend_hash_key key;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
if (spl_object_storage_get_hash(&key, intern, &EX(This), obj) == FAILURE) {
if (spl_object_storage_get_hash(&key, intern, ZEND_THIS, obj) == FAILURE) {
return;
}
@ -471,7 +471,7 @@ SPL_METHOD(SplObjectStorage, offsetGet)
SPL_METHOD(SplObjectStorage, addAll)
{
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
spl_SplObjectStorage *other;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &obj, spl_ce_SplObjectStorage) == FAILURE) {
@ -480,7 +480,7 @@ SPL_METHOD(SplObjectStorage, addAll)
other = Z_SPLOBJSTORAGE_P(obj);
spl_object_storage_addall(intern, &EX(This), other);
spl_object_storage_addall(intern, ZEND_THIS, other);
RETURN_LONG(zend_hash_num_elements(&intern->storage));
} /* }}} */
@ -490,7 +490,7 @@ SPL_METHOD(SplObjectStorage, addAll)
SPL_METHOD(SplObjectStorage, removeAll)
{
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
spl_SplObjectStorage *other;
spl_SplObjectStorageElement *element;
@ -502,7 +502,7 @@ SPL_METHOD(SplObjectStorage, removeAll)
zend_hash_internal_pointer_reset(&other->storage);
while ((element = zend_hash_get_current_data_ptr(&other->storage)) != NULL) {
if (spl_object_storage_detach(intern, &EX(This), &element->obj) == FAILURE) {
if (spl_object_storage_detach(intern, ZEND_THIS, &element->obj) == FAILURE) {
zend_hash_move_forward(&other->storage);
}
}
@ -518,7 +518,7 @@ SPL_METHOD(SplObjectStorage, removeAll)
SPL_METHOD(SplObjectStorage, removeAllExcept)
{
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
spl_SplObjectStorage *other;
spl_SplObjectStorageElement *element;
@ -529,8 +529,8 @@ SPL_METHOD(SplObjectStorage, removeAllExcept)
other = Z_SPLOBJSTORAGE_P(obj);
ZEND_HASH_FOREACH_PTR(&intern->storage, element) {
if (!spl_object_storage_contains(other, &EX(This), &element->obj)) {
spl_object_storage_detach(intern, &EX(This), &element->obj);
if (!spl_object_storage_contains(other, ZEND_THIS, &element->obj)) {
spl_object_storage_detach(intern, ZEND_THIS, &element->obj);
}
} ZEND_HASH_FOREACH_END();
@ -546,19 +546,19 @@ SPL_METHOD(SplObjectStorage, removeAllExcept)
SPL_METHOD(SplObjectStorage, contains)
{
zval *obj;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
RETURN_BOOL(spl_object_storage_contains(intern, &EX(This), obj));
RETURN_BOOL(spl_object_storage_contains(intern, ZEND_THIS, obj));
} /* }}} */
/* {{{ proto int SplObjectStorage::count()
Determine number of objects in storage */
SPL_METHOD(SplObjectStorage, count)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
zend_long mode = COUNT_NORMAL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mode) == FAILURE) {
@ -585,7 +585,7 @@ SPL_METHOD(SplObjectStorage, count)
Rewind to first position */
SPL_METHOD(SplObjectStorage, rewind)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -599,7 +599,7 @@ SPL_METHOD(SplObjectStorage, rewind)
Returns whether current position is valid */
SPL_METHOD(SplObjectStorage, valid)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -612,7 +612,7 @@ SPL_METHOD(SplObjectStorage, valid)
Returns current key */
SPL_METHOD(SplObjectStorage, key)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -626,7 +626,7 @@ SPL_METHOD(SplObjectStorage, key)
SPL_METHOD(SplObjectStorage, current)
{
spl_SplObjectStorageElement *element;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -643,7 +643,7 @@ SPL_METHOD(SplObjectStorage, current)
SPL_METHOD(SplObjectStorage, getInfo)
{
spl_SplObjectStorageElement *element;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -660,7 +660,7 @@ SPL_METHOD(SplObjectStorage, getInfo)
SPL_METHOD(SplObjectStorage, setInfo)
{
spl_SplObjectStorageElement *element;
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
zval *inf;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &inf) == FAILURE) {
@ -678,7 +678,7 @@ SPL_METHOD(SplObjectStorage, setInfo)
Moves position forward */
SPL_METHOD(SplObjectStorage, next)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -692,7 +692,7 @@ SPL_METHOD(SplObjectStorage, next)
Serializes storage */
SPL_METHOD(SplObjectStorage, serialize)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
spl_SplObjectStorageElement *element;
zval members, flags;
@ -729,7 +729,7 @@ SPL_METHOD(SplObjectStorage, serialize)
/* members */
smart_str_appendl(&buf, "m:", 2);
ZVAL_ARR(&members, zend_array_dup(zend_std_get_properties(&EX(This))));
ZVAL_ARR(&members, zend_array_dup(zend_std_get_properties(ZEND_THIS)));
php_var_serialize(&buf, &members, &var_hash); /* finishes the string */
zval_ptr_dtor(&members);
@ -748,7 +748,7 @@ SPL_METHOD(SplObjectStorage, serialize)
Unserializes storage */
SPL_METHOD(SplObjectStorage, unserialize)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
char *buf;
size_t buf_len;
@ -815,7 +815,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
goto outexcept;
}
if (spl_object_storage_get_hash(&key, intern, &EX(This), &entry) == FAILURE) {
if (spl_object_storage_get_hash(&key, intern, ZEND_THIS, &entry) == FAILURE) {
zval_ptr_dtor(&entry);
zval_ptr_dtor(&inf);
goto outexcept;
@ -830,7 +830,7 @@ SPL_METHOD(SplObjectStorage, unserialize)
var_push_dtor(&var_hash, &pelement->obj);
}
}
element = spl_object_storage_attach(intern, &EX(This), &entry, Z_ISUNDEF(inf)?NULL:&inf);
element = spl_object_storage_attach(intern, ZEND_THIS, &entry, Z_ISUNDEF(inf)?NULL:&inf);
var_replace(&var_hash, &entry, &element->obj);
var_replace(&var_hash, &inf, &element->inf);
zval_ptr_dtor(&entry);
@ -946,7 +946,7 @@ SPL_METHOD(MultipleIterator, __construct)
return;
}
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
intern->flags = flags;
}
/* }}} */
@ -955,7 +955,7 @@ SPL_METHOD(MultipleIterator, __construct)
Return current flags */
SPL_METHOD(MultipleIterator, getFlags)
{
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(&EX(This));
spl_SplObjectStorage *intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -969,7 +969,7 @@ SPL_METHOD(MultipleIterator, getFlags)
SPL_METHOD(MultipleIterator, setFlags)
{
spl_SplObjectStorage *intern;
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &intern->flags) == FAILURE) {
return;
@ -988,7 +988,7 @@ SPL_METHOD(MultipleIterator, attachIterator)
return;
}
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (info != NULL) {
spl_SplObjectStorageElement *element;
@ -1008,7 +1008,7 @@ SPL_METHOD(MultipleIterator, attachIterator)
}
}
spl_object_storage_attach(intern, &EX(This), iterator, info);
spl_object_storage_attach(intern, ZEND_THIS, iterator, info);
}
/* }}} */
@ -1020,7 +1020,7 @@ SPL_METHOD(MultipleIterator, rewind)
spl_SplObjectStorageElement *element;
zval *it;
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1043,7 +1043,7 @@ SPL_METHOD(MultipleIterator, next)
spl_SplObjectStorageElement *element;
zval *it;
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1067,7 +1067,7 @@ SPL_METHOD(MultipleIterator, valid)
zval *it, retval;
zend_long expect, valid;
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1175,7 +1175,7 @@ static void spl_multiple_iterator_get_all(spl_SplObjectStorage *intern, int get_
SPL_METHOD(MultipleIterator, current)
{
spl_SplObjectStorage *intern;
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;
@ -1190,7 +1190,7 @@ SPL_METHOD(MultipleIterator, current)
SPL_METHOD(MultipleIterator, key)
{
spl_SplObjectStorage *intern;
intern = Z_SPLOBJSTORAGE_P(&EX(This));
intern = Z_SPLOBJSTORAGE_P(ZEND_THIS);
if (zend_parse_parameters_none() == FAILURE) {
return;

View File

@ -97,7 +97,7 @@ zend_class_entry *php_sqlite3_result_entry;
PHP_METHOD(sqlite3, open)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
char *filename, *encryption_key, *fullpath;
size_t filename_len, encryption_key_len = 0;
zend_long flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
@ -171,7 +171,7 @@ PHP_METHOD(sqlite3, open)
PHP_METHOD(sqlite3, close)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
int errcode;
db_obj = Z_SQLITE3_DB_P(object);
@ -200,7 +200,7 @@ PHP_METHOD(sqlite3, close)
PHP_METHOD(sqlite3, exec)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zend_string *sql;
char *errtext = NULL;
db_obj = Z_SQLITE3_DB_P(object);
@ -243,7 +243,7 @@ PHP_METHOD(sqlite3, version)
PHP_METHOD(sqlite3, lastInsertRowID)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
@ -261,7 +261,7 @@ PHP_METHOD(sqlite3, lastInsertRowID)
PHP_METHOD(sqlite3, lastErrorCode)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3)
@ -283,7 +283,7 @@ PHP_METHOD(sqlite3, lastErrorCode)
PHP_METHOD(sqlite3, lastErrorMsg)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3)
@ -305,7 +305,7 @@ PHP_METHOD(sqlite3, lastErrorMsg)
PHP_METHOD(sqlite3, busyTimeout)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zend_long ms;
#ifdef SQLITE_ENABLE_API_ARMOR
int return_code;
@ -339,7 +339,7 @@ PHP_METHOD(sqlite3, busyTimeout)
PHP_METHOD(sqlite3, loadExtension)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
char *extension, *lib_path, *extension_dir, *errtext = NULL;
char fullpath[MAXPATHLEN];
size_t extension_len, extension_dir_len;
@ -412,7 +412,7 @@ PHP_METHOD(sqlite3, loadExtension)
PHP_METHOD(sqlite3, changes)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
@ -454,7 +454,7 @@ PHP_METHOD(sqlite3, prepare)
{
php_sqlite3_db_object *db_obj;
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zend_string *sql;
int errcode;
php_sqlite3_free_list *free_item;
@ -500,7 +500,7 @@ PHP_METHOD(sqlite3, query)
php_sqlite3_db_object *db_obj;
php_sqlite3_result *result;
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zval stmt;
zend_string *sql;
char *errtext = NULL;
@ -614,7 +614,7 @@ static void sqlite_value_to_zval(sqlite3_stmt *stmt, int column, zval *data) /*
PHP_METHOD(sqlite3, querySingle)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zend_string *sql;
char *errtext = NULL;
int return_code;
@ -901,7 +901,7 @@ static int php_sqlite3_callback_compare(void *coll, int a_len, const void *a, in
PHP_METHOD(sqlite3, createFunction)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
php_sqlite3_func *func;
char *sql_func;
size_t sql_func_len;
@ -951,7 +951,7 @@ PHP_METHOD(sqlite3, createFunction)
PHP_METHOD(sqlite3, createAggregate)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
php_sqlite3_func *func;
char *sql_func;
size_t sql_func_len;
@ -1008,7 +1008,7 @@ PHP_METHOD(sqlite3, createAggregate)
PHP_METHOD(sqlite3, createCollation)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
php_sqlite3_collation *collation;
char *collation_name;
size_t collation_name_len;
@ -1214,7 +1214,7 @@ static const php_stream_ops php_stream_sqlite3_ops = {
PHP_METHOD(sqlite3, openBlob)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
char *table, *column, *dbname = "main", *mode = "rb";
size_t table_len, column_len, dbname_len;
zend_long rowid, flags = SQLITE_OPEN_READONLY, sqlite_flags = 0;
@ -1262,7 +1262,7 @@ PHP_METHOD(sqlite3, openBlob)
PHP_METHOD(sqlite3, enableExceptions)
{
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zend_bool enableExceptions = 0;
db_obj = Z_SQLITE3_DB_P(object);
@ -1282,7 +1282,7 @@ PHP_METHOD(sqlite3, enableExceptions)
PHP_METHOD(sqlite3stmt, paramCount)
{
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
stmt_obj = Z_SQLITE3_STMT_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1301,7 +1301,7 @@ PHP_METHOD(sqlite3stmt, paramCount)
PHP_METHOD(sqlite3stmt, close)
{
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
stmt_obj = Z_SQLITE3_STMT_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1323,7 +1323,7 @@ PHP_METHOD(sqlite3stmt, close)
PHP_METHOD(sqlite3stmt, reset)
{
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
stmt_obj = Z_SQLITE3_STMT_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1346,7 +1346,7 @@ PHP_METHOD(sqlite3stmt, reset)
PHP_METHOD(sqlite3stmt, clear)
{
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
stmt_obj = Z_SQLITE3_STMT_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1376,7 +1376,7 @@ PHP_METHOD(sqlite3stmt, clear)
PHP_METHOD(sqlite3stmt, readOnly)
{
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
stmt_obj = Z_SQLITE3_STMT_P(object);
if (zend_parse_parameters_none() == FAILURE) {
@ -1467,7 +1467,7 @@ static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *pa
PHP_METHOD(sqlite3stmt, bindParam)
{
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
struct php_sqlite3_bound_param param = {0};
zval *parameter;
stmt_obj = Z_SQLITE3_STMT_P(object);
@ -1506,7 +1506,7 @@ PHP_METHOD(sqlite3stmt, bindParam)
PHP_METHOD(sqlite3stmt, bindValue)
{
php_sqlite3_stmt *stmt_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
struct php_sqlite3_bound_param param = {0};
zval *parameter;
stmt_obj = Z_SQLITE3_STMT_P(object);
@ -1548,7 +1548,7 @@ PHP_METHOD(sqlite3stmt, execute)
{
php_sqlite3_stmt *stmt_obj;
php_sqlite3_result *result;
zval *object = &EX(This);
zval *object = ZEND_THIS;
int return_code = 0;
struct php_sqlite3_bound_param *param;
@ -1669,7 +1669,7 @@ PHP_METHOD(sqlite3stmt, __construct)
{
php_sqlite3_stmt *stmt_obj;
php_sqlite3_db_object *db_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zval *db_zval;
zend_string *sql;
int errcode;
@ -1705,7 +1705,7 @@ PHP_METHOD(sqlite3stmt, __construct)
free_item = emalloc(sizeof(php_sqlite3_free_list));
free_item->stmt_obj = stmt_obj;
//?? free_item->stmt_obj_zval = &EX(This);
//?? free_item->stmt_obj_zval = ZEND_THIS;
ZVAL_COPY_VALUE(&free_item->stmt_obj_zval, object);
zend_llist_add_element(&(db_obj->free_list), &free_item);
@ -1717,7 +1717,7 @@ PHP_METHOD(sqlite3stmt, __construct)
PHP_METHOD(sqlite3result, numColumns)
{
php_sqlite3_result *result_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
result_obj = Z_SQLITE3_RESULT_P(object);
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
@ -1735,7 +1735,7 @@ PHP_METHOD(sqlite3result, numColumns)
PHP_METHOD(sqlite3result, columnName)
{
php_sqlite3_result *result_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zend_long column = 0;
char *column_name;
result_obj = Z_SQLITE3_RESULT_P(object);
@ -1760,7 +1760,7 @@ PHP_METHOD(sqlite3result, columnName)
PHP_METHOD(sqlite3result, columnType)
{
php_sqlite3_result *result_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
zend_long column = 0;
result_obj = Z_SQLITE3_RESULT_P(object);
@ -1783,7 +1783,7 @@ PHP_METHOD(sqlite3result, columnType)
PHP_METHOD(sqlite3result, fetchArray)
{
php_sqlite3_result *result_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
int i, ret;
zend_long mode = PHP_SQLITE3_BOTH;
result_obj = Z_SQLITE3_RESULT_P(object);
@ -1840,7 +1840,7 @@ PHP_METHOD(sqlite3result, fetchArray)
PHP_METHOD(sqlite3result, reset)
{
php_sqlite3_result *result_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
result_obj = Z_SQLITE3_RESULT_P(object);
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
@ -1864,7 +1864,7 @@ PHP_METHOD(sqlite3result, reset)
PHP_METHOD(sqlite3result, finalize)
{
php_sqlite3_result *result_obj;
zval *object = &EX(This);
zval *object = ZEND_THIS;
result_obj = Z_SQLITE3_RESULT_P(object);
SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)

View File

@ -402,7 +402,7 @@ static void php_xmlreader_string_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_rea
RETURN_FALSE;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -424,7 +424,7 @@ static void php_xmlreader_no_arg(INTERNAL_FUNCTION_PARAMETERS, xmlreader_read_in
int retval;
xmlreader_object *intern;
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -448,7 +448,7 @@ static void php_xmlreader_no_arg_string(INTERNAL_FUNCTION_PARAMETERS, xmlreader_
char *retchar = NULL;
xmlreader_object *intern;
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -483,7 +483,7 @@ static void php_xmlreader_set_relaxng_schema(INTERNAL_FUNCTION_PARAMETERS, int t
RETURN_FALSE;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -526,7 +526,7 @@ PHP_METHOD(xmlreader, close)
zval *id;
xmlreader_object *intern;
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
/* libxml is segfaulting in versions up to 2.6.8 using xmlTextReaderClose so for
now we will free the whole reader when close is called as it would get rebuilt on
@ -558,7 +558,7 @@ PHP_METHOD(xmlreader, getAttributeNo)
return;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -589,7 +589,7 @@ PHP_METHOD(xmlreader, getAttributeNs)
RETURN_FALSE;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -615,7 +615,7 @@ PHP_METHOD(xmlreader, getParserProperty)
return;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -667,7 +667,7 @@ PHP_METHOD(xmlreader, moveToAttribute)
RETURN_FALSE;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -695,7 +695,7 @@ PHP_METHOD(xmlreader, moveToAttributeNo)
return;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -729,7 +729,7 @@ PHP_METHOD(xmlreader, moveToAttributeNs)
RETURN_FALSE;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -775,7 +775,7 @@ PHP_METHOD(xmlreader, read)
int retval;
xmlreader_object *intern;
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern != NULL && intern->ptr != NULL) {
retval = xmlTextReaderRead(intern->ptr);
@ -805,7 +805,7 @@ PHP_METHOD(xmlreader, next)
return;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern != NULL && intern->ptr != NULL) {
retval = xmlTextReaderNext(intern->ptr);
@ -935,7 +935,7 @@ PHP_METHOD(xmlreader, setSchema)
RETURN_FALSE;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -972,7 +972,7 @@ PHP_METHOD(xmlreader, setParserProperty)
return;
}
id = &EX(This);
id = ZEND_THIS;
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
@ -1105,7 +1105,7 @@ PHP_METHOD(xmlreader, expand)
xmlDocPtr docp = NULL;
php_libxml_node_object *domobj = NULL;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O!", &basenode, dom_node_class_entry) == FAILURE) {
return;
}

View File

@ -399,7 +399,7 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
xmlNode *nodep = NULL;
zval *cloneDocu, member, rv;
id = &EX(This);
id = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &docp) == FAILURE) {
RETURN_FALSE;
}
@ -622,7 +622,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
zend_string *ret_class = NULL;
xsl_object *intern;
id = &EX(This);
id = ZEND_THIS;
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
@ -679,7 +679,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
char *uri;
xsl_object *intern;
id = &EX(This);
id = ZEND_THIS;
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;
@ -711,7 +711,7 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
int doc_txt_len;
xsl_object *intern;
id = &EX(This);
id = ZEND_THIS;
intern = Z_XSL_P(id);
sheetp = (xsltStylesheetPtr) intern->ptr;

View File

@ -1441,7 +1441,7 @@ static ZIPARCHIVE_METHOD(open)
zend_long flags = 0;
char *resolved_path;
zend_string *filename;
zval *self = &EX(This);
zval *self = ZEND_THIS;
ze_zip_object *ze_obj;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "P|l", &filename, &flags) == FAILURE) {
@ -1495,7 +1495,7 @@ Set the password for the active archive */
static ZIPARCHIVE_METHOD(setPassword)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
char *password;
size_t password_len;
@ -1523,7 +1523,7 @@ close the zip archive */
static ZIPARCHIVE_METHOD(close)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
ze_zip_object *ze_obj;
int err;
@ -1558,7 +1558,7 @@ close the zip archive */
static ZIPARCHIVE_METHOD(count)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
ZIP_FROM_OBJECT(intern, self);
@ -1571,7 +1571,7 @@ static ZIPARCHIVE_METHOD(count)
static ZIPARCHIVE_METHOD(getStatusString)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
#if LIBZIP_VERSION_MAJOR < 1
int zep, syp, len;
char error_string[128];
@ -1599,7 +1599,7 @@ Returns the index of the entry named filename in the archive */
static ZIPARCHIVE_METHOD(addEmptyDir)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
char *dirname;
size_t dirname_len;
int idx;
@ -1646,7 +1646,7 @@ static ZIPARCHIVE_METHOD(addEmptyDir)
static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
char *path = ".";
char *remove_path = NULL;
char *add_path = NULL;
@ -1767,7 +1767,7 @@ Add a file in a Zip archive using its path and the name to use. */
static ZIPARCHIVE_METHOD(addFile)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
char *entry_name = NULL;
size_t entry_name_len = 0;
zend_long offset_start = 0, offset_len = 0;
@ -1803,7 +1803,7 @@ Add a file using content and the entry name */
static ZIPARCHIVE_METHOD(addFromString)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_string *buffer;
char *name;
size_t name_len;
@ -1861,7 +1861,7 @@ Returns the information about a the zip entry filename */
static ZIPARCHIVE_METHOD(statName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long flags = 0;
struct zip_stat sb;
zend_string *name;
@ -1883,7 +1883,7 @@ Returns the zip entry information using its index */
static ZIPARCHIVE_METHOD(statIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long index, flags = 0;
struct zip_stat sb;
@ -1907,7 +1907,7 @@ Returns the index of the entry named filename in the archive */
static ZIPARCHIVE_METHOD(locateName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long flags = 0;
zend_long idx = -1;
zend_string *name;
@ -1937,7 +1937,7 @@ Returns the name of the file at position index */
static ZIPARCHIVE_METHOD(getNameIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
const char *name;
zend_long flags = 0, index = 0;
@ -1963,7 +1963,7 @@ Set or remove (NULL/'') the comment of the archive */
static ZIPARCHIVE_METHOD(setArchiveComment)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
size_t comment_len;
char * comment;
@ -1985,7 +1985,7 @@ Returns the comment of an entry using its index */
static ZIPARCHIVE_METHOD(getArchiveComment)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long flags = 0;
const char * comment;
int comment_len = 0;
@ -2009,7 +2009,7 @@ Set or remove (NULL/'') the comment of an entry using its Name */
static ZIPARCHIVE_METHOD(setCommentName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
size_t comment_len, name_len;
char * comment, *name;
int idx;
@ -2038,7 +2038,7 @@ Set or remove (NULL/'') the comment of an entry using its index */
static ZIPARCHIVE_METHOD(setCommentIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long index;
size_t comment_len;
char * comment;
@ -2064,7 +2064,7 @@ Set external attributes for file in zip, using its name */
static ZIPARCHIVE_METHOD(setExternalAttributesName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
size_t name_len;
char *name;
zend_long flags=0, opsys, attr;
@ -2098,7 +2098,7 @@ Set external attributes for file in zip, using its index */
static ZIPARCHIVE_METHOD(setExternalAttributesIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long index, flags=0, opsys, attr;
struct zip_stat sb;
@ -2123,7 +2123,7 @@ Get external attributes for file in zip, using its name */
static ZIPARCHIVE_METHOD(getExternalAttributesName)
{
struct zip *intern;
zval *self = &EX(This), *z_opsys, *z_attr;
zval *self = ZEND_THIS, *z_opsys, *z_attr;
size_t name_len;
char *name;
zend_long flags=0;
@ -2163,7 +2163,7 @@ Get external attributes for file in zip, using its index */
static ZIPARCHIVE_METHOD(getExternalAttributesIndex)
{
struct zip *intern;
zval *self = &EX(This), *z_opsys, *z_attr;
zval *self = ZEND_THIS, *z_opsys, *z_attr;
zend_long index, flags=0;
zip_uint8_t opsys;
zip_uint32_t attr;
@ -2196,7 +2196,7 @@ Set encryption method for file in zip, using its name */
static ZIPARCHIVE_METHOD(setEncryptionName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long method;
zip_int64_t idx;
char *name, *password = NULL;
@ -2230,7 +2230,7 @@ Set encryption method for file in zip, using its index */
static ZIPARCHIVE_METHOD(setEncryptionIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long index, method;
char *password = NULL;
size_t password_len;
@ -2255,7 +2255,7 @@ Returns the comment of an entry using its name */
static ZIPARCHIVE_METHOD(getCommentName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
size_t name_len;
int idx;
zend_long flags = 0;
@ -2289,7 +2289,7 @@ Returns the comment of an entry using its index */
static ZIPARCHIVE_METHOD(getCommentIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long index, flags = 0;
const char * comment;
int comment_len = 0;
@ -2313,7 +2313,7 @@ Set the compression of a file in zip, using its name */
static ZIPARCHIVE_METHOD(setCompressionName)
{
struct zip *intern;
zval *this = &EX(This);
zval *this = ZEND_THIS;
size_t name_len;
char *name;
zip_int64_t idx;
@ -2348,7 +2348,7 @@ Set the compression of a file in zip, using its index */
static ZIPARCHIVE_METHOD(setCompressionIndex)
{
struct zip *intern;
zval *this = &EX(This);
zval *this = ZEND_THIS;
zend_long index;
zend_long comp_method, comp_flags = 0;
@ -2372,7 +2372,7 @@ Delete a file using its index */
static ZIPARCHIVE_METHOD(deleteIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long index;
ZIP_FROM_OBJECT(intern, self);
@ -2398,7 +2398,7 @@ Delete a file using its index */
static ZIPARCHIVE_METHOD(deleteName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
size_t name_len;
char *name;
struct zip_stat sb;
@ -2425,7 +2425,7 @@ Rename an entry selected by its index to new_name */
static ZIPARCHIVE_METHOD(renameIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
char *new_name;
size_t new_name_len;
zend_long index;
@ -2457,7 +2457,7 @@ Rename an entry selected by its name to new_name */
static ZIPARCHIVE_METHOD(renameName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
struct zip_stat sb;
char *name, *new_name;
size_t name_len, new_name_len;
@ -2487,7 +2487,7 @@ Changes to the file at position index are reverted */
static ZIPARCHIVE_METHOD(unchangeIndex)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zend_long index;
ZIP_FROM_OBJECT(intern, self);
@ -2513,7 +2513,7 @@ Changes to the file named 'name' are reverted */
static ZIPARCHIVE_METHOD(unchangeName)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
struct zip_stat sb;
char *name;
size_t name_len;
@ -2543,7 +2543,7 @@ All changes to files and global information in archive are reverted */
static ZIPARCHIVE_METHOD(unchangeAll)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
ZIP_FROM_OBJECT(intern, self);
@ -2560,7 +2560,7 @@ Revert all global changes to the archive archive. For now, this only reverts ar
static ZIPARCHIVE_METHOD(unchangeArchive)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
ZIP_FROM_OBJECT(intern, self);
@ -2583,7 +2583,7 @@ static ZIPARCHIVE_METHOD(extractTo)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
zval *zval_files = NULL;
zval *zval_file = NULL;
php_stream_statbuf ssb;
@ -2663,7 +2663,7 @@ static ZIPARCHIVE_METHOD(extractTo)
static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
struct zip_stat sb;
struct zip_file *zf;
@ -2743,7 +2743,7 @@ get a stream for an entry using its name */
static ZIPARCHIVE_METHOD(getStream)
{
struct zip *intern;
zval *self = &EX(This);
zval *self = ZEND_THIS;
struct zip_stat sb;
char *mode = "rb";
zend_string *filename;