| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
char type;
char *name;
zend_uint name_length;
- struct _zend_class_entry *parent;
+ struct _zend_class_entry *parent;
int refcount;
zend_bool constants_updated;
zend_uint ce_flags;
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
} zend_utility_functions;
-
+
typedef struct _zend_utility_values {
char *import_use_extension;
uint import_use_extension_length;
#define INIT_PZVAL(z) \
(z)->refcount = 1; \
- (z)->is_ref = 0;
+ (z)->is_ref = 0;
#define INIT_ZVAL(z) z = zval_used_for_init;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
char *class_name;
zend_uint class_name_len;
int dup;
-
+
dup = zend_get_object_classname(*value, &class_name, &class_name_len TSRMLS_CC);
ALLOC_ZVAL(value_ptr);
while (param_count-->0) {
zval **param = (zval **) p-(arg_count--);
zval_add_ref(param);
- add_next_index_zval(argument_array, *param);
+ add_next_index_zval(argument_array, *param);
}
return SUCCESS;
{
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
-
+
zend_error(E_WARNING, "Wrong parameter count for %v%s%v()", class_name, space, get_active_function_name(TSRMLS_C));
}
if (Z_OBJ_HT_P(object)->get_class_name == NULL ||
Z_OBJ_HT_P(object)->get_class_name(object, class_name, class_name_len, 0 TSRMLS_CC) != SUCCESS) {
zend_class_entry *ce = Z_OBJCE_P(object);
-
+
*class_name = ce->name;
*class_name_len = ce->name_length;
return 1;
#define RETURN_AS_STRING(arg, p, pl, type) \
*(char**)p = Z_STRVAL_PP(arg); \
*pl = Z_STRLEN_PP(arg); \
- *type = IS_STRING;
+ *type = IS_STRING;
#define RETURN_AS_UNICODE(arg, p, pl, type) \
*(UChar**)p = Z_USTRVAL_PP(arg); \
}
}
}
-
+
case IS_ARRAY:
case IS_RESOURCE:
default:
}
}
}
-
+
case IS_ARRAY:
case IS_RESOURCE:
default:
}
}
}
-
+
case IS_ARRAY:
case IS_RESOURCE:
default:
}
}
}
-
+
case IS_ARRAY:
case IS_RESOURCE:
default:
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%v%s%v() expects parameter %d to be a class name derived from %v, '%v' given",
- class_name, space, get_active_function_name(TSRMLS_C),
+ class_name, space, get_active_function_name(TSRMLS_C),
arg_num, ce_base->name, Z_STRVAL_PP(arg));
*pce = NULL;
return "";
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%v%s%v() expects parameter %d to be a valid class name, '%v' given",
- class_name, space, get_active_function_name(TSRMLS_C),
+ class_name, space, get_active_function_name(TSRMLS_C),
arg_num, Z_STRVAL_PP(arg));
return "";
}
break;
-
+
}
break;
}
return FAILURE;
}
-
+
return SUCCESS;
}
if (!quiet) {
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
- zend_error(E_WARNING, "%v%s%v(): bad type specifier while parsing parameters",
+ zend_error(E_WARNING, "%v%s%v(): bad type specifier while parsing parameters",
class_name, space,
get_active_function_name(TSRMLS_C));
}
}
i++;
break;
-
+
case '|': case '!':
case '/':
/* pass */
{
va_list va;
int retval;
-
+
va_start(va, type_spec);
retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC);
va_end(va);
{
va_list va;
int retval;
-
+
va_start(va, type_spec);
retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC);
va_end(va);
}
-/* This function should be called after the constructor has been called
+/* This function should be called after the constructor has been called
* because it may call __set from the uninitialized object otherwise. */
ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC)
{
zend_u_hash_add(CE_STATIC_MEMBERS(class_type), utype, str_index, str_length, (void**)q, sizeof(zval*), NULL);
} else {
zval *q;
-
+
ALLOC_ZVAL(q);
*q = **p;
INIT_PZVAL(q);
}
}
zend_hash_apply_with_argument(CE_STATIC_MEMBERS(class_type), (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
-
+
*scope = old_scope;
class_type->constants_updated = 1;
}
/* This function requires 'properties' to contain all props declared in the
- * class and all props being public. If only a subset is given or the class
+ * class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties seperately by
* calling zend_merge_properties(). */
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC)
}
zend_update_class_constants(class_type TSRMLS_CC);
-
+
Z_TYPE_P(arg) = IS_OBJECT;
if (class_type->create_object == NULL) {
Z_OBJVAL_P(arg) = zend_objects_new(&object, class_type TSRMLS_CC);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, void *str, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODE(tmp, str, duplicate);
ZEND_API int add_assoc_unicodel_ex(zval *arg, char *key, uint key_len, void *str, uint length, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODEL(tmp, str, length, duplicate);
ZEND_API int add_index_bool(zval *arg, ulong index, int b)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_index_resource(zval *arg, ulong index, int r)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_index_double(zval *arg, ulong index, double d)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_index_unicode(zval *arg, ulong index, UChar *str, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODE(tmp, str, duplicate);
ZEND_API int add_index_unicodel(zval *arg, ulong index, UChar *str, uint length, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODEL(tmp, str, length, duplicate);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_next_index_long(zval *arg, long n)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_next_index_null(zval *arg)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_next_index_bool(zval *arg, int b)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_next_index_resource(zval *arg, int r)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_next_index_double(zval *arg, double d)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
-
+
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
-
+
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, l);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API int add_get_index_stringl(zval *arg, ulong index, char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API int add_get_index_unicode(zval *arg, ulong index, UChar *str, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODE(tmp, str, duplicate);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API int add_get_index_unicodel(zval *arg, ulong index, UChar *str, uint length, void **dest, int duplicate)
{
zval *tmp;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODEL(tmp, str, length, duplicate);
-
+
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
-
+
MAKE_STD_ZVAL(z_key);
ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1);
{
zval *tmp;
zval *z_key;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
-
+
MAKE_STD_ZVAL(z_key);
ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1);
{
zval *tmp;
zval *z_key;
-
+
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, n);
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
-
+
MAKE_STD_ZVAL(z_key);
ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1);
zend_error(E_CORE_WARNING, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name);
module->module_started = 0;
return FAILURE;
- }
+ }
efree(lcname);
}
++dep;
Bucket **b1 = base;
Bucket **b2;
Bucket **end = b1 + count;
- Bucket *tmp;
+ Bucket *tmp;
zend_module_entry *m, *r;
while (b1 < end) {
if (strcasecmp(dep->name, r->name) == 0) {
tmp = *b1;
*b1 = *b2;
- *b2 = tmp;
+ *b2 = tmp;
goto try_again;
}
b2++;
}
}
dep++;
- }
+ }
}
b1++;
}
int name_len;
char *lcname;
zend_module_entry *module_ptr;
-
+
if (!module) {
return NULL;
}
/* TODO: Check version relationship */
zend_error(E_CORE_WARNING, "Cannot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name);
return NULL;
- }
+ }
efree(lcname);
}
++dep;
int name_len;
zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
- /* we don't care if the function name is longer, in fact lowercasing only
+ /* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
if (UG(unicode)) {
name_len = u_strlen((UChar*)fptr->common.function_name);
}
lcname = zend_u_str_case_fold(utype, fptr->common.function_name, name_len, 0, &lcname_len);
- if (lcname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 &&
+ if (lcname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 &&
ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && fptr->common.num_args != 0) {
zend_error(error_type, "Destuctor %v::%s() cannot take arguments", ce->name, ZEND_DESTRUCTOR_FUNC_NAME);
} else if (lcname_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 &&
return SUCCESS;
}
-/* count=-1 means erase all functions, otherwise,
+/* count=-1 means erase all functions, otherwise,
* erase the first count functions
*/
ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC)
ZEND_API int zend_startup_module(zend_module_entry *module)
{
TSRMLS_FETCH();
-
+
if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL &&
zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) {
return SUCCESS;
ZEND_API int zend_get_module_started(char *module_name)
{
zend_module_entry *module;
-
+
return (zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void**)&module) == SUCCESS && module->module_started) ? SUCCESS : FAILURE;
}
} else {
class_entry->interfaces = erealloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces));
}
-
+
while (num_interfaces--) {
interface_entry = va_arg(interface_list, zend_class_entry *);
class_entry->interfaces[class_entry->num_interfaces++] = interface_entry;
{
zend_class_entry *disabled_class;
disabled_class = (zend_class_entry *) emalloc(sizeof(zend_class_entry));
-
+
zend_str_tolower(class_name, class_name_length);
if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
return FAILURE;
zend_function *fptr;
zend_class_entry **pce;
HashTable *ftable;
-
+
*ce_ptr = NULL;
*fptr_ptr = NULL;
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) {
return 1;
}
-
+
return zend_is_callable_check_func(check_flags|IS_CALLABLE_CHECK_IS_STATIC, zobj_ptr_ptr, NULL, callable, ce_ptr, fptr_ptr TSRMLS_CC);
case IS_ARRAY:
zend_class_entry *ce = NULL;
zval **method;
zval **obj;
-
+
if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2 &&
zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj) == SUCCESS &&
zend_hash_index_find(Z_ARRVAL_P(callable), 1, (void **) &method) == SUCCESS &&
efree(lcname);
} else {
ce = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */
-
+
*zobj_ptr_ptr = obj;
if (callable_name) {
switch (Z_TYPE_P(callable)) {
case IS_STRING:
lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
-
+
if ((func = strstr(lcname, "::")) != NULL) {
*func = '\0';
class_name_len = func - lcname;
add_next_index_stringl(callable, lcname, class_name_len, 1);
func += 2;
add_next_index_stringl(callable, func, strlen(func), 1);
- retval = 1;
+ retval = 1;
}
efree(class_name);
}
pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS);
}
zend_u_hash_update(target_symbol_table, type, name, name_length+1, &property, sizeof(zval *), NULL);
- property_info.name = ce->type & ZEND_INTERNAL_CLASS ?
- (type==IS_UNICODE?(char*)zend_ustrndup(name, name_length):zend_strndup(name, name_length)) :
+ property_info.name = ce->type & ZEND_INTERNAL_CLASS ?
+ (type==IS_UNICODE?(char*)zend_ustrndup(name, name_length):zend_strndup(name, name_length)) :
(type==IS_UNICODE?(char*)eustrndup(name, name_length):estrndup(name, name_length));
property_info.name_length = name_length;
break;
property_info.doc_comment = doc_comment;
property_info.doc_comment_len = doc_comment_len;
-
+
zend_u_hash_update(&ce->properties_info, type, name, name_length + 1, &property_info, sizeof(zend_property_info), NULL);
return SUCCESS;
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
{
zval *property;
int len = strlen(value);
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC)
{
zval *property;
-
+
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
ZVAL_STRINGL(property, zend_strndup(value, value_len), value_len, 0);
{
zval *property;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->write_property) {
zend_uint class_name_len;
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
-
+
zend_error(E_CORE_ERROR, "Property %s of class %v cannot be updated", name, class_name);
}
MAKE_STD_ZVAL(property);
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_ascii_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_ascii_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_rt_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_rt_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
{
zval **property;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
property = zend_std_get_static_property(scope, IS_STRING, name, name_length, 0 TSRMLS_CC);
EG(scope) = old_scope;
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_ascii_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_rt_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char *name, int name_length, UChar *value TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
ZEND_API int zend_update_static_property_unicodel(zend_class_entry *scope, char *name, int name_length, UChar *value, int value_len TSRMLS_DC)
{
zval *tmp;
-
+
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
{
zval *property, *value;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->read_property) {
{
zval **property;
zend_class_entry *old_scope = EG(scope);
-
+
EG(scope) = scope;
property = zend_std_get_static_property(scope, IS_STRING, name, name_length, silent TSRMLS_CC);
EG(scope) = old_scope;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b TSRMLS_CC)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r TSRMLS_CC)
-#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
+#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_ascii_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_ascii_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_rt_string(__arg, __key, __str, __duplicate) add_property_ascii_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_rt_stringl(__arg, __key, __str, __length, __duplicate) add_property_rt_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
-#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
+#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
#define add_property_unicode(__arg, __key, __str, __duplicate) add_property_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_unicodel(__arg, __key, __str, __length, __duplicate) add_property_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D
END_EXTERN_C()
-
+
#endif /* ZEND_API_H */
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
#if MEMORY_LIMIT
AG(allocated_memory) -= SIZE;
#endif
-
+
ZEND_DO_FREE(p);
HANDLE_UNBLOCK_INTERRUPTIONS();
}
{
void *p;
int final_size = size*nmemb;
-
+
HANDLE_BLOCK_INTERRUPTIONS();
p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
if (!p) {
p->lineno = __zend_lineno;
p->magic = MEM_BLOCK_START_MAGIC;
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
-#endif
+#endif
p->size = size;
ZEND_API void start_memory_manager(TSRMLS_D)
{
AG(head) = NULL;
-
+
#if MEMORY_LIMIT
AG(memory_limit) = 1<<30; /* ridiculous limit, effectively no limit */
AG(allocated_memory) = 0;
}
fprintf(stderr, "\n");
}
-
+
} while (0);
#endif
zend_debug_alloc_output("Unknown\n");
}
}
-
+
if (!silent) {
zend_debug_alloc_output("---------------------------------------\n");
}
TSRMLS_FETCH();
p = AG(head);
-
+
zend_debug_alloc_output("------------------------------------------------\n");
zend_debug_alloc_output("Full Memory Check at %s:%d\n" ZEND_FILE_LINE_RELAY_CC);
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1)
ZEND_END_ARG_INFO();
-
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
i = op_array->last_var;
op_array->last_var++;
if (op_array->last_var > op_array->size_var) {
- op_array->size_var += 16; /* FIXME */
+ op_array->size_var += 16; /* FIXME */
op_array->vars = erealloc(op_array->vars, op_array->size_var*sizeof(zend_compiled_variable));
}
op_array->vars[i].name = name; /* estrndup(name, name_len); */
if (last_op_number > 0) {
zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1];
-
+
switch (last_op->opcode) {
case ZEND_FETCH_OBJ_RW:
last_op->opcode = op;
zend_op *opline_ptr;
zend_llist *fetch_list_ptr;
- if (varname->op_type == IS_CONST &&
- (Z_TYPE(varname->u.constant) == IS_STRING ||
+ if (varname->op_type == IS_CONST &&
+ (Z_TYPE(varname->u.constant) == IS_STRING ||
Z_TYPE(varname->u.constant) == IS_UNICODE) &&
!zend_u_is_auto_global(Z_TYPE(varname->u.constant), Z_UNIVAL(varname->u.constant), Z_UNILEN(varname->u.constant) TSRMLS_CC) &&
!(Z_UNILEN(varname->u.constant) == (sizeof("this")-1) &&
SET_UNUSED(opline_ptr->op2);
opline_ptr->op2.u.EA.type = ZEND_FETCH_LOCAL;
- if (varname->op_type == IS_CONST &&
+ if (varname->op_type == IS_CONST &&
(Z_TYPE(varname->u.constant) == IS_STRING ||
Z_TYPE(varname->u.constant) == IS_UNICODE)) {
if (zend_u_is_auto_global(Z_TYPE(varname->u.constant), Z_UNIVAL(varname->u.constant), Z_UNILEN(varname->u.constant) TSRMLS_CC)) {
opline.result.u.EA.type = 0;
opline.result.u.var = get_temporary_variable(CG(active_op_array));
opline.op1.op_type = IS_CONST;
- ZVAL_TEXTL(&opline.op1.u.constant,
+ ZVAL_TEXTL(&opline.op1.u.constant,
CG(active_op_array)->vars[result->u.var].name,
CG(active_op_array)->vars[result->u.var].name_len, 1);
SET_UNUSED(opline.op2);
char *method_type;
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
- Z_LVAL(modifiers->u.constant) |= ZEND_ACC_ABSTRACT;
+ Z_LVAL(modifiers->u.constant) |= ZEND_ACC_ABSTRACT;
method_type = "Interface";
} else {
method_type = "Abstract";
{
if ((opline->opcode == ZEND_FETCH_W) && (opline->op1.op_type == IS_CONST)
&& (Z_TYPE(opline->op1.u.constant) == IS_STRING ||
- Z_TYPE(opline->op1.u.constant) == IS_UNICODE)
+ Z_TYPE(opline->op1.u.constant) == IS_UNICODE)
&& (Z_UNILEN(opline->op1.u.constant) == (sizeof("this")-1))
&& ZEND_U_EQUAL(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), "this", sizeof("this")-1)) {
return 1;
while (last_op_number - n > 0) {
zend_op *last_op;
-
+
last_op = &CG(active_op_array)->opcodes[last_op_number-n-1];
if (last_op->result.op_type == IS_VAR &&
opline->opcode = ZEND_ASSIGN_REF;
if (zend_is_function_or_method_call(rvar)) {
- opline->extended_value = ZEND_RETURNS_FUNCTION;
+ opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
opline->op1.u.opline_num = while_token->u.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
-
+
/* update while's conditional jmp */
CG(active_op_array)->opcodes[close_bracket_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
}
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &if_end_op_number);
-
+
CG(active_op_array)->opcodes[closing_bracket_token->u.opline_num].op2.u.opline_num = if_end_op_number+1;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
le = fetch_list_ptr->head;
/* TODO: $foo->x->y->z = 1 should fetch "x" and "y" for R or RW, not just W */
-
+
if (le) {
opline_ptr = (zend_op *)le->data;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
}
} else if (op1->op_type == IS_CONST) {
zval_dtor(&op1->u.constant);
- }
+ }
}
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
-
+
{
/* Push a seperator to the switch and foreach stacks */
zend_switch_entry switch_entry;
-
+
switch_entry.cond.op_type = IS_UNUSED;
switch_entry.default_case = 0;
switch_entry.control_var = 0;
} else {
zend_uchar utype;
- /* we don't care if the function name is longer, in fact lowercasing only
+ /* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
if (UG(unicode)) {
utype = IS_UNICODE;
ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1) &&
CG(active_op_array)->num_args != 1) {
zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME);
- }
+ }
if (lcname != lcname_buf) {
efree(lcname);
}
zend_function *function;
unsigned int lcname_len;
char *lcname;
-
+
lcname = zend_u_str_case_fold(Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant), Z_UNILEN(function_name->u.constant), 0, &lcname_len);
if (zend_u_hash_find(CG(function_table), Z_TYPE(function_name->u.constant), lcname, lcname_len+1, (void **) &function)==FAILURE) {
zend_do_begin_dynamic_function_call(function_name TSRMLS_CC);
} else {
Z_STRVAL(function_name->u.constant) = lcname;
}
-
+
switch (function->type) {
case ZEND_USER_FUNCTION: {
zend_op_array *op_array = (zend_op_array *) function;
-
+
zend_stack_push(&CG(function_call_stack), (void *) &op_array, sizeof(zend_function *));
}
break;
case ZEND_INTERNAL_FUNCTION: {
zend_internal_function *internal_function = (zend_internal_function *) function;
-
+
zend_stack_push(&CG(function_call_stack), (void *) &internal_function, sizeof(zend_function *));
}
break;
}
- zend_do_extended_fcall_begin(TSRMLS_C);
+ zend_do_extended_fcall_begin(TSRMLS_C);
return 0;
}
zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC);
zend_do_begin_variable_parse(TSRMLS_C);
-
+
last_op_number = get_next_op_number(CG(active_op_array))-1;
last_op = &CG(active_op_array)->opcodes[last_op_number];
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
- zend_do_extended_fcall_begin(TSRMLS_C);
+ zend_do_extended_fcall_begin(TSRMLS_C);
}
-
+
void zend_do_clone(znode *result, znode *expr TSRMLS_DC)
{
SET_UNUSED(opline->op1);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
- zend_do_extended_fcall_begin(TSRMLS_C);
+ zend_do_extended_fcall_begin(TSRMLS_C);
}
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC)
{
zend_op *opline;
-
+
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
/* clone */
if (Z_LVAL(argument_list->u.constant) != 0) {
SET_UNUSED(opline->op1);
}
}
-
+
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->result.op_type = IS_VAR;
*result = opline->result;
zend_function **function_ptr_ptr, *function_ptr;
int send_by_reference;
int send_function = 0;
-
+
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL;
send_by_reference = 0;
} else {
- send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
+ send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
}
} else {
send_by_reference = 0;
static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
{
zend_op *opline;
-
+
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type != IS_TMP_VAR) {
return (switch_entry->cond.op_type == IS_UNUSED);
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_SWITCH_FREE;
/* If we reach the seperator then stop applying the stack */
if (foreach_copy->result.op_type == IS_UNUSED && foreach_copy->op1.op_type == IS_UNUSED) {
return 1;
- }
+ }
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
SET_UNUSED(opline->op2);
opline->extended_value = 0;
}
-
+
return 0;
}
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
{
zend_op *opline;
-
+
if (do_end_vparse) {
if (CG(active_op_array)->return_reference && !zend_is_function_or_method_call(expr)) {
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_RETURN;
-
+
if (expr) {
opline->op1 = *expr;
} else {
if (do_end_vparse) {
if (zend_is_function_or_method_call(expr)) {
- opline->extended_value = ZEND_RETURNS_FUNCTION;
+ opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
{
long catch_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
-
+
if (catch_op_number > 0) {
opline = &CG(active_op_array)->opcodes[catch_op_number-1];
if (opline->opcode == ZEND_FETCH_CLASS) {
void zend_do_throw(znode *expr TSRMLS_DC)
{
zend_op *opline;
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_THROW;
opline->op1 = *expr;
}
return;
}
-
+
if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **)&function)==SUCCESS) {
/* inherit parent's constructor */
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
if (parent->common.fn_flags & ZEND_ACC_ABSTRACT
&& parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
&& child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
- zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %v::%v() (previously declared abstract in %v)",
+ zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %v::%v() (previously declared abstract in %v)",
parent->common.scope->name,
child->common.function_name,
child->common.prototype ? child->common.prototype->common.scope->name : child->common.scope->name);
*/
if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %v::%v() must be %s (as in class %v)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
- } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
+ } else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
&& ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
child->common.fn_flags |= ZEND_ACC_CHANGED;
}
child->common.prototype = parent->common.prototype;
}
-
+
if (child->common.prototype) {
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
zend_error(E_COMPILE_ERROR, "Declaration of %v::%v() must be compatible with that of %v::%v()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
zend_class_entry *parent_ce = ce->parent;
zend_uchar utype;
TSRMLS_FETCH();
-
+
utype = UG(unicode)?IS_UNICODE:IS_STRING;
if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) {
if (zend_u_hash_quick_find(&ce->properties_info, hash_key->type, hash_key->u.string, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) {
if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) {
zend_error(E_COMPILE_ERROR, "Cannot redeclare %s%v::$%R as %s%v::$%R",
(parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name, hash_key->type, hash_key->u.string,
- (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->type, hash_key->u.string);
+ (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->type, hash_key->u.string);
}
-
+
if(parent_info->flags & ZEND_ACC_CHANGED) {
child_info->flags |= ZEND_ACC_CHANGED;
}
-
+
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %v::$%R must be %s (as in class %v)%s", ce->name, hash_key->type, hash_key->u.string, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
if (!(parent_info->flags & ZEND_ACC_IMPLICIT_PUBLIC)) {
/* Explicitly copy the default value from the parent (if it has one) */
zval **pvalue;
-
+
if (zend_u_hash_quick_find(&parent_ce->default_properties, utype, parent_info->name, parent_info->name_length+1, parent_info->h, (void **) &pvalue) == SUCCESS) {
(*pvalue)->refcount++;
zend_u_hash_del(&ce->default_properties, utype, child_info->name, child_info->name_length+1);
if (Z_TYPE_PP(new_prop) != IS_NULL && Z_TYPE_PP(prop) != IS_NULL) {
char *prop_name, *tmp;
- zend_u_unmangle_property_name(utype, child_info->name, &tmp, &prop_name);
- zend_error(E_COMPILE_ERROR, "Cannot change initial value of property static protected %v::$%v in class %v",
+ zend_u_unmangle_property_name(utype, child_info->name, &tmp, &prop_name);
+ zend_error(E_COMPILE_ERROR, "Cannot change initial value of property static protected %v::$%v in class %v",
parent_ce->name, prop_name, ce->name);
}
}
if (*old_constant != *parent_constant) {
zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %R from interface %v", hash_key->type, hash_key->u.string, iface->name);
}
- return 0;
+ return 0;
}
return 1;
}
return SUCCESS;
}
}
-
+
ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC)
{
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
-
+
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
-
+
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
{
zend_op *opline;
zend_switch_entry *switch_entry_ptr;
-
+
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
/* add code to jmp to default case */
zval_copy_ctor(&opline->op1.u.constant);
}
result = opline->result;
-
+
next_op_number = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->op1.op_type = IS_CONST;
build_runtime_defined_function_key(&opline->op1.u.constant, Z_TYPE(class_name->u.constant), lcname, lcname_len TSRMLS_CC);
-
+
opline->op2.op_type = IS_CONST;
Z_TYPE(opline->op2.u.constant) = Z_TYPE(class_name->u.constant);
opline->op2.u.constant.refcount = 1;
-
+
if (doing_inheritance) {
opline->extended_value = parent_class_name->u.var;
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
Z_STRVAL(opline->op2.u.constant) = lcname;
Z_STRLEN(opline->op2.u.constant) = lcname_len;
}
-
+
zend_u_hash_update(CG(class_table), Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), &new_class_entry, sizeof(zend_class_entry *), NULL);
CG(active_class_entry) = new_class_entry;
}
break;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_INTERFACE;
opline->op1 = CG(implementing_class);
{
char *prop_name;
int prop_name_length;
-
+
prop_name_length = 1 + src1_length + 1 + src2_length;
prop_name = pemalloc(prop_name_length + 1, internal);
prop_name[0] = '\0';
void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC)
{
zval *property;
-
+
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
}
-
+
ALLOC_ZVAL(property);
if (value) {
zend_op opline;
zend_llist *fetch_list_ptr;
zend_op *opline_ptr=NULL;
-
+
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
-
+
if (fetch_list_ptr->count == 1) {
zend_llist_element *le;
{
zend_op *opline;
unsigned char *ptr = NULL;
-
+
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_NEW;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *class_type;
SET_UNUSED(opline->op2);
-
+
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
}
case ZEND_RT:
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
-
+
opline->opcode = ZEND_FETCH_CONSTANT;
opline->result.op_type = IS_TMP_VAR;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
break;
case IS_LONG:
- case IS_BOOL:
+ case IS_BOOL:
zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
break;
case IS_DOUBLE:
break;
}
- }
+ }
}
zend_do_end_variable_parse(BP_VAR_IS, 0 TSRMLS_CC);
zend_check_writable_variable(variable);
-
+
if (variable->op_type == IS_CV) {
last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
last_op->result.u.var = get_temporary_variable(CG(active_op_array));
} else {
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
-
+
switch (last_op->opcode) {
case ZEND_FETCH_IS:
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
opline->extended_value |= ZEND_FETCH_CLASS_NO_AUTOLOAD;
}
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INSTANCEOF;
opline->result.op_type = IS_TMP_VAR;
void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, znode *as_token TSRMLS_DC)
{
zend_op *opline;
-
+
/* save the location of FE_FETCH */
as_token->u.opline_num = get_next_op_number(CG(active_op_array));
}
value_node = opline->result;
-
+
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
if (assign_by_ref) {
/* Mark FE_FETCH as IS_VAR as it holds the data directly as a value */
if (Z_USTRVAL(opline->op2.u.constant)[Z_USTRLEN(opline->op2.u.constant)-1]=='\r') {
Z_USTRVAL(opline->op2.u.constant)[(Z_USTRLEN(opline->op2.u.constant)--)-1] = 0;
}
- }
+ }
} else {
Z_STRVAL(opline->op2.u.constant)[(Z_STRLEN(opline->op2.u.constant)--)-1] = 0;
if (Z_STRLEN(opline->op2.u.constant)>0) {
if (Z_STRVAL(opline->op2.u.constant)[Z_STRLEN(opline->op2.u.constant)-1]=='\r') {
Z_STRVAL(opline->op2.u.constant)[(Z_STRLEN(opline->op2.u.constant)--)-1] = 0;
}
- }
+ }
}
}
{
int jmpz_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
opline->result = *qm_token;
opline->op1 = *false_value;
SET_UNUSED(opline->op2);
-
+
CG(active_op_array)->opcodes[colon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
*result = opline->result;
void zend_do_extended_info(TSRMLS_D)
{
zend_op *opline;
-
+
if (!CG(extended_info)) {
return;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_STMT;
void zend_do_extended_fcall_begin(TSRMLS_D)
{
zend_op *opline;
-
+
if (!CG(extended_info)) {
return;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_BEGIN;
void zend_do_extended_fcall_end(TSRMLS_D)
{
zend_op *opline;
-
+
if (!CG(extended_info)) {
return;
}
-
+
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_END;
efree(Z_STRVAL(zendlval->u.constant));
break;
}
-
+
INIT_PZVAL(&zendlval->u.constant);
zendlval->op_type = IS_CONST;
return retval;
{
if ((class_name_len == sizeof("self")-1) &&
ZEND_U_EQUAL(type, class_name, class_name_len, "self", sizeof("self")-1)) {
- return ZEND_FETCH_CLASS_SELF;
+ return ZEND_FETCH_CLASS_SELF;
} else if ((class_name_len == sizeof("parent")-1) &&
ZEND_U_EQUAL(type, class_name, class_name_len, "parent", sizeof("parent")-1)) {
return ZEND_FETCH_CLASS_PARENT;
void zend_do_normalization(znode *result, znode *str TSRMLS_DC)
{
zend_op *opline;
-
+
if (!UG(unicode)) {
*result = *str;
return;
- }
+ }
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_U_NORMALIZE;
opline->result.op_type = IS_TMP_VAR;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
struct _zend_op_array {
/* Common elements */
zend_uchar type;
- char *function_name;
+ char *function_name;
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
typedef struct _zend_internal_function {
/* Common elements */
zend_uchar type;
- char *function_name;
+ char *function_name;
zend_class_entry *scope;
- zend_uint fn_flags;
+ zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
zend_bool pass_rest_by_reference;
unsigned char return_reference;
} common;
-
+
zend_op_array op_array;
zend_internal_function internal_function;
} zend_function;
/* helper functions in zend_language_scanner.l */
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
-ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
+ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC);
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC);
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
/* This will cause the compilation process to be MUCH longer, but will generate
* a much quicker PHP binary
*/
-/*
+/*
#undef inline
#ifdef ZEND_WIN32_FORCE_INLINE
# define inline __forceinline
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
#define ZEND_DLEXPORT __declspec(dllexport)
#define ZEND_DLIMPORT __declspec(dllimport)
-/* 0x00200000L is MB_SERVICE_NOTIFICATION, which is only supported under Windows NT
+/* 0x00200000L is MB_SERVICE_NOTIFICATION, which is only supported under Windows NT
* (and requires _WIN32_WINNT to be defined, which prevents the resulting executable
* from running under Windows 9x
* Windows 9x should silently ignore it, so it's being used here directly
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
/* true/false constants */
{
zend_constant c;
-
+
Z_TYPE(c.value) = IS_BOOL;
c.flags = CONST_PERSISTENT;
c.module_number = 0;
Z_LVAL(c.value) = 1;
Z_TYPE(c.value) = IS_BOOL;
zend_register_constant(&c TSRMLS_CC);
-
+
c.name = zend_strndup(ZEND_STRL("FALSE"));
c.name_len = sizeof("FALSE");
Z_LVAL(c.value) = 0;
ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
-
+
Z_TYPE(c.value) = IS_LONG;
Z_LVAL(c.value) = lval;
c.flags = flags;
ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
-
+
Z_TYPE(c.value) = IS_DOUBLE;
Z_DVAL(c.value) = dval;
c.flags = flags;
ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
-
+
Z_TYPE(c.value) = IS_STRING;
Z_STRVAL(c.value) = strval;
Z_STRLEN(c.value) = strlen;
} else {
scope = CG(active_class_entry);
}
-
+
if (UG(unicode)) {
class_name = (char*)eustrndup((UChar*)name, class_name_len);
} else {
zend_error(E_ERROR, "Cannot access self:: when no class scope is active");
retval = 0;
}
- } else if (class_name_len == sizeof("parent")-1 &&
+ } else if (class_name_len == sizeof("parent")-1 &&
ZEND_U_EQUAL(type, class_name, class_name_len, "parent", sizeof("parent")-1)) {
- if (!scope) {
+ if (!scope) {
zend_error(E_ERROR, "Cannot access parent:: when no class scope is active");
- } else if (!scope->parent) {
- zend_error(E_ERROR, "Cannot access parent:: when current class scope has no parent");
+ } else if (!scope->parent) {
+ zend_error(E_ERROR, "Cannot access parent:: when current class scope has no parent");
} else {
ce = &scope->parent;
}
*result = **ret_constant;
zval_copy_ctor(result);
}
-
+
return retval;
}
-
+
if (zend_u_hash_find(EG(zend_constants), type, name, name_len+1, (void **) &c) == FAILURE) {
unsigned int lookup_name_len;
lookup_name = zend_u_str_case_fold(type, name, name_len, 1, &lookup_name_len);
-
+
if (zend_u_hash_find(EG(zend_constants), type, lookup_name, lookup_name_len+1, (void **) &c)==SUCCESS) {
if ((c->flags & CONST_CS) && memcmp(c->name, name, UG(unicode)?UBYTES(name_len):name_len)!=0) {
retval=0;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
UErrorCode status = U_ZERO_ERROR;
UChar *u_str;
int32_t u_len;
-
+
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
efree(u_str);
UErrorCode status = U_ZERO_ERROR;
UChar *u_str;
int32_t u_len;
-
+
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
efree(u_str);
}
zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
-
+
if (argc >= 4) {
if (file_type == IS_UNICODE) {
zend_update_property_unicodel(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
- } else {
+ } else {
zend_update_property_stringl(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
}
if (argc < 5) {
if(!dup) {
efree(class_name);
}
-
+
TRACE_APPEND_STR("), ");
break;
}
zval *trace;
char *res = estrdup(""), **str = &res, *s_tmp;
int res_len = 0, *len = &res_len, num = 0;
-
+
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
- res[res_len] = '\0';
- RETURN_STRINGL(res, res_len, 0);
+ res[res_len] = '\0';
+ RETURN_STRINGL(res, res_len, 0);
}
/* }}} */
va_list arg;
int len;
- va_start(arg, format);
+ va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
va_end(arg);
return len;
}
if (Z_UNILEN(message) > 0) {
- len = zend_spprintf(&str, 0, "exception '%v' with message '%R' in %R:%ld\nStack trace:\n%s",
- Z_OBJCE_P(getThis())->name, Z_TYPE(message), Z_UNIVAL(message), Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
+ len = zend_spprintf(&str, 0, "exception '%v' with message '%R' in %R:%ld\nStack trace:\n%s",
+ Z_OBJCE_P(getThis())->name, Z_TYPE(message), Z_UNIVAL(message), Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n");
} else {
- len = zend_spprintf(&str, 0, "exception '%v' in %R:%ld\nStack trace:\n%s",
- Z_OBJCE_P(getThis())->name, Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
+ len = zend_spprintf(&str, 0, "exception '%v' in %R:%ld\nStack trace:\n%s",
+ Z_OBJCE_P(getThis())->name, Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n");
}
/* All functions that may be used in uncaught exception handlers must be final
* and must not throw exceptions. Otherwise we would need a facility to handle
- * such exceptions in that handler.
+ * such exceptions in that handler.
* Also all getXY() methods are final because thy serve as read only access to
- * their corresponding properties, no more, no less. If after all you need to
+ * their corresponding properties, no more, no less. If after all you need to
* override somthing then it is method __toString().
* And never try to change the state of exceptions and never implement anything
* that gives the user anything to accomplish this.
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
- default_exception_ce->create_object = zend_default_exception_new;
+ default_exception_ce->create_object = zend_default_exception_new;
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
default_exception_handlers.clone_obj = NULL;
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
- error_exception_ce->create_object = zend_error_exception_new;
+ error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
exception_ce = default_exception_ce;
}
object_init_ex(ex, exception_ce);
-
+
if (message) {
zend_update_property_rt_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
char *message;
zval *zexception;
- va_start(arg, format);
+ va_start(arg, format);
zend_vspprintf(&message, 0, format, arg);
va_end(arg);
zexception = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...)
{
va_list args;
-
+
va_start(args, format);
zend_error_cb(type, file, lineno, format, args);
va_end(args);
zval *str, *file, *line;
EG(exception) = NULL;
-
+
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
if (!EG(exception)) {
if (Z_TYPE_P(str) != IS_STRING) {
}
}
zval_ptr_dtor(&str);
-
+
if (EG(exception)) {
/* do the best we can to inform about the inner exception */
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
ZEND_API void zend_register_default_classes(TSRMLS_D);
-/* exception_ce NULL or zend_exception_get_default() or a derived class
+/* exception_ce NULL or zend_exception_get_default() or a derived class
* message NULL or the message of the exception */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...);
(z)->value = (v)->value; \
Z_TYPE_P(z) = Z_TYPE_P(v); \
(z)->refcount = 1; \
- (z)->is_ref = 0;
+ (z)->is_ref = 0;
#define MAKE_REAL_ZVAL_PTR(val) \
do { \
static inline void zend_get_cv_address(zend_uchar utype, zend_compiled_variable *cv, zval ***ptr, temp_variable *Ts TSRMLS_DC)
{
zval *new_zval = &EG(uninitialized_zval);
-
+
new_zval->refcount++;
zend_u_hash_quick_update(EG(active_symbol_table), utype, cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
}
static inline zval *_get_zval_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
-
+
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
static inline zval **_get_zval_ptr_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
-
+
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
if (!arg) {
if (ptr && ptr->op_array) {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
- } else {
+ } else {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array", arg_num, fclass, fsep, fname);
}
}
break;
case IS_ARRAY:
break;
- default:
+ default:
if (ptr && ptr->op_array) {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
-
+
if (Z_TYPE_P(object) != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op2);
FREE_OP(free_value);
return;
}
-
+
/* here we are sure we are dealing with an object */
/* separate our value if necessary */
char *class_name;
zend_uint class_name_len;
int dup;
-
+
ALLOC_ZVAL(value);
*value = *orig_value;
value->is_ref = 0;
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", class_name);
}
- zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name);
+ zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name);
Z_OBJVAL_P(value) = Z_OBJ_HANDLER_P(orig_value, clone_obj)(orig_value TSRMLS_CC);
if (!dup) {
efree(class_name);
value->refcount = 0;
zval_copy_ctor(value);
}
-
+
value->refcount++;
if (opcode == ZEND_ASSIGN_OBJ) {
}
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
-
+
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr = value;
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
zend_free_op free_op1;
zval **variable_ptr_ptr = get_zval_ptr_ptr(op1, Ts, &free_op1, BP_VAR_W);
zval *variable_ptr;
-
+
if (!variable_ptr_ptr) {
temp_variable *T = &T(op1->u.var);
}
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(final_value)[0];
-
+
if (op2->op_type == IS_TMP_VAR) {
if (final_value == &T(op2->u.var).tmp_var) {
/* we can safely free final_value here
}
} while (0);
/* zval_ptr_dtor(&T->str_offset.str); Nuke this line if it doesn't cause a leak */
-
+
/* T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); */
if (!RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = &value;
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr_ptr, value TSRMLS_CC);
goto done_setting_var;
}
-
+
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
-
+
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
-
+
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", class_name);
} else if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr!=value) {
zend_uint refcount = variable_ptr->refcount;
zval garbage;
-
+
if (type!=IS_TMP_VAR) {
value->refcount++;
}
variable_ptr->refcount++;
} else if (PZVAL_IS_REF(value)) {
zval tmp;
-
+
tmp = *value;
zval_copy_ctor(&tmp);
tmp.refcount=1;
}
(*variable_ptr_ptr)->is_ref=0;
}
-
+
done_setting_var:
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
AI_USE_PTR(T(result->u.var).var);
- }
+ }
FREE_OP_VAR_PTR(free_op1);
}
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
-
+
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", class_name);
} else {
goto fetch_string_dim;
case IS_STRING:
case IS_UNICODE:
-
+
offset_key = Z_UNIVAL_P(dim);
offset_key_length = Z_UNILEN_P(dim)+1;
-
+
fetch_string_dim:
if (UG(unicode) && ht == &EG(symbol_table) && ztype == IS_UNICODE) {
/* Identifier normalization */
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(dim), Z_LVAL_P(dim));
/* Fall Through */
case IS_DOUBLE:
- case IS_BOOL:
+ case IS_BOOL:
case IS_LONG: {
long index;
}
}
break;
- default:
+ default:
zend_error(E_WARNING, "Illegal offset type");
switch (type) {
case BP_VAR_R:
if (!container_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
-
+
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
if (zend_hash_next_index_insert(Z_ARRVAL_P(container), &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
retval = &EG(error_zval_ptr);
- new_zval->refcount--;
+ new_zval->refcount--;
}
} else {
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, type TSRMLS_CC);
zend_error_noreturn(E_ERROR, "Cannot use object as array");
} else {
zval *overloaded_result;
-
+
if (dim_is_tmp_var) {
zval *orig = dim;
MAKE_REAL_ZVAL_PTR(dim);
ZVAL_NULL(orig);
- }
+ }
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
if (overloaded_result) {
return;
}
break;
- default: {
+ default: {
switch (type) {
case BP_VAR_UNSET:
zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, int type TSRMLS_DC)
{
zval *container;
-
+
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
if (result) {
break;
}
}
-
+
if (Z_TYPE_P(container) != IS_OBJECT) {
if (result) {
if (type == BP_VAR_R || type == BP_VAR_IS) {
}
return;
}
-
+
if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) {
zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr TSRMLS_CC);
if (NULL == ptr_ptr) {
result->var.ptr_ptr = &EG(error_zval_ptr);
}
}
-
+
if (result) {
PZVAL_LOCK(*result->var.ptr_ptr);
- }
+ }
}
static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, zend_op_array *op_array, temp_variable *Ts TSRMLS_DC)
} else if (Z_TYPE_PP(pz) == IS_ARRAY) {
zend_hash_apply(Z_ARRVAL_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
} else if (Z_TYPE_PP(pz) == IS_OBJECT) {
-
+
/* OBJ-TBI - doesn't support new object model! */
zend_hash_apply(Z_OBJPROP_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
break;
}
}
-
+
if(EG(ze1_compatibility_mode)) {
result = (zend_hash_num_elements(Z_OBJPROP_P(op))?1:0);
} else {
}
if (UG(unicode)) {
- if (Z_TYPE(const_value) == IS_UNICODE &&
+ if (Z_TYPE(const_value) == IS_UNICODE &&
Z_USTRLEN(const_value) == str_index_len-1 &&
!u_strncmp(Z_USTRVAL(const_value), (UChar*)str_index, str_index_len)) {
/* constant value is the same as its name */
continue;
}
} else {
- if (Z_TYPE(const_value) == IS_STRING &&
+ if (Z_TYPE(const_value) == IS_STRING &&
Z_STRLEN(const_value) == str_index_len-1 &&
!strncmp(Z_STRVAL(const_value), str_index, str_index_len)) {
/* constant value is the same as its name */
zend_class_entry **ce;
int found = FAILURE;
- if (EG(active_op_array) &&
+ if (EG(active_op_array) &&
Z_UNILEN_PP(fci->object_pp) == sizeof("self")-1 &&
ZEND_U_EQUAL(Z_TYPE_PP(fci->object_pp), Z_UNIVAL_PP(fci->object_pp), Z_UNILEN_PP(fci->object_pp), "self", sizeof("self")-1)) {
if (!EG(active_op_array)->scope) {
if (found == FAILURE) {
zend_error(E_ERROR, "Class '%R' not found", Z_TYPE_PP(fci->object_pp), Z_UNIVAL_PP(fci->object_pp));
}
- if (scope && EG(This) &&
+ if (scope && EG(This) &&
instanceof_function(Z_OBJCE_P(EG(This)), scope TSRMLS_CC) &&
instanceof_function(scope, *ce TSRMLS_CC)) {
fci->object_pp = &EG(This);
if (Z_OBJ_HT_PP(fci->object_pp)->get_method == NULL) {
zend_error(E_ERROR, "Object does not support method calls");
}
- EX(function_state).function =
+ EX(function_state).function =
Z_OBJ_HT_PP(fci->object_pp)->get_method(fci->object_pp, fname, fname_len TSRMLS_CC);
if (EX(function_state).function && calling_scope != EX(function_state).function->common.scope) {
void *function_name_lc = zend_u_str_tolower_dup(Z_TYPE_P(fci->function_name), fname, fname_len);
unsigned int lcname_len;
char *lcname = zend_u_str_case_fold(Z_TYPE_P(fci->function_name), fname, fname_len, 1, &lcname_len);
- EX(function_state).function =
+ EX(function_state).function =
zend_std_get_static_method(calling_scope, lcname, lcname_len TSRMLS_CC);
efree(lcname);
if (check_scope_or_static && EX(function_state).function
efree(lcname);
}
- if (EX(function_state).function == NULL) {
+ if (EX(function_state).function == NULL) {
/* try calling __call */
if (calling_scope && calling_scope->__call) {
EX(function_state).function = calling_scope->__call;
calling_scope = fci_cache->calling_scope;
fci->object_pp = fci_cache->object_pp;
}
-
- if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
+
+ if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
}
- if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
- zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
+ if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
+ zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
if (name == NULL) {
return FAILURE;
}
-
+
lc_name = zend_u_str_case_fold(type, name, name_length, 1, &lc_name_len);
if (zend_u_hash_find(EG(class_table), type, lc_name, lc_name_len+1, (void **) ce) == SUCCESS) {
ALLOC_HASHTABLE(EG(in_autoload));
zend_u_hash_init(EG(in_autoload), 0, NULL, NULL, 0, UG(unicode));
}
-
+
if (zend_u_hash_add(EG(in_autoload), type, lc_name, lc_name_len+1, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
efree(lc_name);
return FAILURE;
} else {
ZVAL_STRINGL(class_name_ptr, name, name_length, 1);
}
-
+
args[0] = &class_name_ptr;
-
+
fcall_info.size = sizeof(fcall_info);
fcall_info.function_table = EG(function_table);
fcall_info.function_name = &autoload_function;
if (local_retval) {
zval_ptr_dtor(&local_retval);
}
-
+
if (EG(exception)) {
zend_exception_error(EG(exception) TSRMLS_CC);
}
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t) zend_verify_abstract_class_function, &ai TSRMLS_CC);
- if (ai.cnt) {
- zend_error(E_ERROR, "Class %v contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
- ce->name, ai.cnt,
+ if (ai.cnt) {
+ zend_error(E_ERROR, "Class %v contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
+ ce->name, ai.cnt,
ai.cnt > 1 ? "s" : "",
DISPLAY_ABSTRACT_FN(0),
DISPLAY_ABSTRACT_FN(1),
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
new_extension->name);
DL_UNLOAD(handle);
return FAILURE;
- }
+ }
} else if (ZTS_V!=extension_version_info->thread_safe) {
fprintf(stderr, "Cannot load %s - it %s thread safe, whereas Zend %s\n",
new_extension->name,
* Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X
*
*/
-
+
#if HAVE_MACH_O_DYLD_H
-void *zend_mh_bundle_load(char* bundle_path)
+void *zend_mh_bundle_load(char* bundle_path)
{
NSObjectFileImage bundle_image;
NSModule bundle_handle;
if (NSCreateObjectFileImageFromFile(bundle_path, &bundle_image) != NSObjectFileImageSuccess) {
return NULL;
}
-
+
bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_PRIVATE);
NSDestroyObjectFileImage(bundle_image);
-
+
/* call the init function of the bundle */
bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, "__init");
if (bundle_init_nssymbol != NULL) {
bundle_init = NSAddressOfSymbol(bundle_init_nssymbol);
bundle_init();
}
-
+
return bundle_handle;
}
{
NSSymbol bundle_fini_nssymbol;
void (*bundle_fini)(void);
-
+
/* call the fini function of the bundle */
bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, "__fini");
if (bundle_fini_nssymbol != NULL) {
bundle_fini = NSAddressOfSymbol(bundle_fini_nssymbol);
bundle_fini();
}
-
+
return (int) NSUnLinkModule(bundle_handle, NULL);
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
op_array_handler_func_t op_array_handler;
- statement_handler_func_t statement_handler;
+ statement_handler_func_t statement_handler;
fcall_begin_handler_func_t fcall_begin_handler;
fcall_end_handler_func_t fcall_end_handler;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
zend_uchar key_type;
if (type == IS_STRING) {
- key_type = HASH_KEY_IS_STRING;
+ key_type = HASH_KEY_IS_STRING;
HANDLE_NUMERIC((char*)arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL, 0, idx));
} else if (type == IS_UNICODE) {
- key_type = HASH_KEY_IS_UNICODE;
+ key_type = HASH_KEY_IS_UNICODE;
HANDLE_U_NUMERIC((UChar*)arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL, 0, idx));
}
return zend_hash_update_current_key(ht, key_type, arKey, nKeyLength, 0);
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
* numbers are not useable at all. The remaining 128 odd numbers
* (except for the number 1) work more or less all equally well. They
* all distribute in an acceptable way and this way fill a hash table
- * with an average percent of approx. 86%.
+ * with an average percent of approx. 86%.
*
* If one compares the Chi^2 values of the variants, the number 33 not
* even has the best value. But the number 33 and a few other equally
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
case T_CONSTANT_ENCAPSED_STRING:
next_color = syntax_highlighter_ini->highlight_string;
break;
- case '"':
+ case '"':
next_color = syntax_highlighter_ini->highlight_string;
in_string = !in_string;
- break;
+ break;
case T_WHITESPACE:
zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC); /* no color needed */
Z_TYPE(token) = 0;
case EOF:
return;
-
+
case T_END_HEREDOC:
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
efree(Z_STRVAL(token));
prev_space = 1;
Z_TYPE(token) = 0;
continue;
-
+
default:
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
break;
* indent-tabs-mode: t
* End:
*/
-
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
#include "zend_operators.h"
#include "zend_strtod.h"
-static HashTable *registered_zend_ini_directives;
+static HashTable *registered_zend_ini_directives;
#define NO_VALUE_PLAINTEXT "no value"
#define NO_VALUE_HTML "<i>no value</i>"
{
Bucket *f;
Bucket *s;
-
+
f = *((Bucket **) a);
s = *((Bucket **) b);
}
duplicate = estrndup(new_value, new_value_length);
-
+
if (!ini_entry->on_modify
|| ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC)==SUCCESS) {
if (!ini_entry->modified) {
} else {
display_string = NO_VALUE_PLAINTEXT;
display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
- }
+ }
}
} else if (ini_entry->value && ini_entry->value[0]) {
display_string = ini_entry->value;
} else {
display_string = NO_VALUE_PLAINTEXT;
display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
- }
+ }
}
ZEND_WRITE(display_string, display_string_length);
}
else {
value = atoi(tmp_value);
}
-
+
if (value) {
ZEND_PUTS("On");
} else {
zend_printf("<font style=\"color: %s\">%s</font>", value, value);
} else {
ZEND_PUTS(value);
- }
+ }
} else {
if (zend_uv.html_errors) {
ZEND_PUTS(NO_VALUE_HTML);
} else {
ZEND_PUTS(NO_VALUE_PLAINTEXT);
- }
+ }
}
}
if (new_value_length==2 && strcasecmp("on", new_value)==0) {
*p = (zend_bool) 1;
- }
+ }
else if (new_value_length==3 && strcasecmp("yes", new_value)==0) {
*p = (zend_bool) 1;
- }
+ }
else if (new_value_length==4 && strcasecmp("true", new_value)==0) {
*p = (zend_bool) 1;
- }
+ }
else {
*p = (zend_bool) atoi(new_value);
}
#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \
ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL)
-
+
#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer)
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
ZEND_API zend_class_entry *zend_ce_arrayaccess;
ZEND_API zend_class_entry *zend_ce_serializable;
-/* {{{ zend_call_method
+/* {{{ zend_call_method
Only returns the returned zval if retval_ptr != NULL */
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
{
zval *object = (zval*)iter->it.data;
zval *more;
int result;
-
+
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more);
if (more) {
result = i_zend_is_true(more);
return HASH_KEY_IS_LONG;
}
switch (Z_TYPE_P(retval)) {
- default:
+ default:
zend_error(E_WARNING, "Illegal type returned from %v::key()", iter->ce->name);
case IS_NULL:
*int_key = 0;
case IS_DOUBLE:
case IS_RESOURCE:
- case IS_BOOL:
+ case IS_BOOL:
case IS_LONG: {
if (Z_TYPE_P(retval) == IS_DOUBLE) {
*int_key = (long)Z_DVAL_P(retval);
static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
zend_user_iterator *iterator;
-
+
if (by_ref) {
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
zval * zdata;
object_init_ex(*object, ce);
-
+
MAKE_STD_ZVAL(zdata);
ZVAL_STRINGL(zdata, (char*)buf, buf_len, 1);
zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, zdata);
-
+
zval_ptr_dtor(&zdata);
-
+
if (EG(exception)) {
return FAILURE;
} else {
ZEND_END_ARG_INFO();
static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
zend_function_entry zend_funcs_serializable[] = {
ZEND_ABSTRACT_ME(serializable, serialize, NULL)
- ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
+ ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
{NULL, NULL, NULL}
};
/* }}} */
REGISTER_ITERATOR_INTERFACE(iterator, Iterator);
REGISTER_ITERATOR_IMPLEMENT(iterator, traversable);
-
+
REGISTER_ITERATOR_INTERFACE(arrayaccess, ArrayAccess);
-
+
REGISTER_ITERATOR_INTERFACE(serializable, Serializable)
}
/* }}} */
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC)
{
zval *wrapped;
-
+
MAKE_STD_ZVAL(wrapped);
Z_TYPE_P(wrapped) = IS_OBJECT;
Z_OBJ_HANDLE_P(wrapped) = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC);
return ZEND_ITER_PLAIN_OBJECT;
}
return ZEND_ITER_INVALID;
-
-
+
+
case IS_ARRAY:
if (HASH_OF(array_ptr)) {
return ZEND_ITER_PLAIN_ARRAY;
}
return ZEND_ITER_INVALID;
-
+
default:
return ZEND_ITER_INVALID;
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
typedef struct _zend_object_iterator_funcs {
/* release all resources associated with this iterator instance */
void (*dtor)(zend_object_iterator *iter TSRMLS_DC);
-
+
/* check for end of iteration (FAILURE or SUCCESS if data is valid) */
int (*valid)(zend_object_iterator *iter TSRMLS_DC);
/* rewind to start of data (optional, may be NULL) */
void (*rewind)(zend_object_iterator *iter TSRMLS_DC);
-
+
/* invalidate current value/key (optional, may be NULL) */
void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC);
} zend_object_iterator_funcs;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
UConverter *output_conv; /* converter for data from flex output */
zend_bool encoding_checked;
char* rest_str;
- int rest_len;
+ int rest_len;
} zend_lex_state;
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh)
{
TSRMLS_FETCH();
-
+
switch (fh->type) {
case ZEND_HANDLE_FP:
fclose(fh->handle.fp);
case UCNV_EBCDIC_STATEFUL:
case UCNV_ISO_2022:
case UCNV_LMBCS_1:
- case UCNV_LMBCS_2:
+ case UCNV_LMBCS_2:
case UCNV_LMBCS_3:
case UCNV_LMBCS_4:
case UCNV_LMBCS_5:
}
zend_llist_add_element(&CG(open_files), file_handle);
-
+
/* Reset the scanner for scanning the new file */
SCNG(yy_in) = file_handle;
}
Z_STRVAL_P(zendlval) = emalloc(len+1);
- Z_STRLEN_P(zendlval) = sprintf(Z_STRVAL_P(zendlval), "%s%s%s",
+ Z_STRLEN_P(zendlval) = sprintf(Z_STRVAL_P(zendlval), "%s%s%s",
class_name ? class_name : "",
class_name && func_name ? "::" : "",
func_name ? func_name : ""
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
ZEND_API int _zend_list_delete(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
-
+
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */
if (--le->refcount<=0) {
ZEND_API int _zend_list_addref(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
-
+
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */
le->refcount++;
int rsrc_id;
rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type);
-
+
if (rsrc_result) {
Z_RESVAL_P(rsrc_result) = rsrc_id;
Z_TYPE_P(rsrc_result) = IS_RESOURCE;
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
zend_rsrc_list_dtors_entry *ld;
TSRMLS_FETCH();
-
+
if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) {
switch (ld->type) {
case ZEND_RESOURCE_LIST_TYPE_STD:
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number)
{
zend_rsrc_list_dtors_entry lde;
-
+
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
-
+
lde.list_dtor=(void (*)(void *)) ld;
lde.plist_dtor=(void (*)(void *)) pld;
lde.list_dtor_ex = lde.plist_dtor_ex = NULL;
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_STD;
lde.type_name = NULL;
-
+
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
return FAILURE;
}
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number)
{
zend_rsrc_list_dtors_entry lde;
-
+
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_EX;
lde.type_name = type_name;
-
+
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
return FAILURE;
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
ZEND_API void zend_llist_destroy(zend_llist *l)
{
zend_llist_element *current=l->head, *next;
-
+
while (current) {
next = current->next;
if (l->dtor) {
if (l->tail->prev) {
l->tail->prev->next = NULL;
}
-
+
data = old_tail->data;
l->tail = l->tail->prev;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
zend_heap_activate_leaf(heap->heap, index);
}
} else {
- free_list_bucket = &heap->free_buckets[0];
+ free_list_bucket = &heap->free_buckets[0];
}
mm_block->next_free_block = *free_list_bucket;
if (*free_list_bucket != NULL) {
block_size -= ZEND_MM_ALIGNED_SEGMENT_SIZE;
mm_block = (zend_mm_free_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
-
+
mm_block->size = block_size - ZEND_MM_ALIGNED_HEADER_SIZE; /* keep one guard block in the end */
mm_block->type = ZEND_MM_FREE_BLOCK;
mm_block->prev_size = 0; /* Size is always at least ZEND_MM_ALIGNED_HEADER_SIZE big (>0) so 0 is OK */
-
+
/* setup guard block */
guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
guard_block->type = ZEND_MM_USED_BLOCK;
true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE);
index = ZEND_MM_BUCKET_INDEX(true_size);
-
+
if (index < ZEND_MM_NUM_BUCKETS) {
free_list_bucket = &heap->free_buckets[index];
if (*free_list_bucket) {
leaf = zend_heap_search_leaf(heap->heap, index);
if (leaf != 0) {
best_fit = heap->free_buckets[leaf];
- goto zend_mm_finished_searching_for_block;
+ goto zend_mm_finished_searching_for_block;
}
}
}
{
zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p);
zend_mm_block *prev_block, *next_block;
-
+
if (mm_block->type != ZEND_MM_USED_BLOCK) {
/* error */
return;
break;
}
seg = seg->next_segment;
- }
+ }
}
mm_block = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
}
if (next_block->type != ZEND_MM_FREE_BLOCK || (mm_block->size + next_block->size < true_size)) {
void *ptr;
-
+
ptr = zend_mm_alloc(heap, size);
memcpy(ptr, p, mm_block->size - ZEND_MM_ALIGNED_HEADER_SIZE);
zend_mm_free(heap, p);
mm_block->size += next_block->size;
/* update the next block's prev_size */
ZEND_MM_BLOCK_AT(mm_block, mm_block->size)->prev_size = mm_block->size;
-
+
zend_mm_create_new_free_block(heap, mm_block, true_size);
return p;
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
enable accessors to change properties array.
if we have __call and method which is not part of the class function table is
- called, we cal __call handler.
+ called, we cal __call handler.
*/
static HashTable *zend_std_get_properties(zval *object TSRMLS_DC)
{
zval *retval = NULL;
zend_class_entry *ce = Z_OBJCE_P(object);
-
+
/* __get handler is called with one argument:
property name
it should return whether the call was successfull or not
*/
-
+
SEPARATE_ARG_IF_REF(member);
zend_call_method_with_1_params(&object, ce, &ce->__get, ZEND_GET_FUNC_NAME, &retval, member);
static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC)
{
zend_class_entry *ce = Z_OBJCE_P(object);
-
+
/* __unset handler is called with one argument:
property name
*/
-
+
SEPARATE_ARG_IF_REF(member);
zend_call_method_with_1_params(&object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member);
{
zval *retval = NULL;
zend_class_entry *ce = Z_OBJCE_P(object);
-
+
/* __isset handler is called with one argument:
property name
it should return whether the property is set or not
*/
-
+
SEPARATE_ARG_IF_REF(member);
zend_call_method_with_1_params(&object, ce, &ce->__isset, ZEND_ISSET_FUNC_NAME, &retval, member);
zend_error(E_ERROR, "Cannot access property started with '\\0'");
}
}
- return NULL;
+ return NULL;
}
h = zend_u_get_hash_value(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member) + 1);
if (zend_u_hash_quick_find(&ce->properties_info, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Read object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member));
-#endif
+#endif
/* make zend_get_property_info silent if we have getter - we may want to use it */
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
if (rv) {
retval = &rv;
} else {
- retval = &EG(uninitialized_zval_ptr);
+ retval = &EG(uninitialized_zval_ptr);
}
} else {
if (!silent) {
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval *retval;
-
+
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
if(offset == NULL) {
/* [] construct */
zend_class_entry *ce = Z_OBJCE_P(object);
zval *retval;
int result;
-
+
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset);
zval tmp_member;
zval **retval;
zend_property_info *property_info;
-
+
zobj = Z_OBJ_P(object);
if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Ptr object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member));
-#endif
+#endif
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
zend_object *zobj;
zval *tmp_member = NULL;
zend_property_info *property_info;
-
+
zobj = Z_OBJ_P(object);
if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
}
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__unset != NULL) TSRMLS_CC);
-
+
if (!property_info || zend_u_hash_del(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1)) {
zend_guard *guard;
static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC)
{
zend_class_entry *ce = Z_OBJCE_P(object);
-
+
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset);
zval *method_name_ptr, *method_args_ptr;
zval *method_result_ptr = NULL;
zend_class_entry *ce = Z_OBJCE_P(this_ptr);
-
+
ALLOC_ZVAL(method_args_ptr);
INIT_PZVAL(method_args_ptr);
array_init(method_args_ptr);
RETVAL_ZVAL(method_result_ptr, 0, 1);
}
}
-
+
/* now destruct all auxiliaries */
zval_ptr_dtor(&method_args_ptr);
zval_ptr_dtor(&method_name_ptr);
unsigned int lc_method_name_len;
char *lc_method_name;
zval *object = *object_ptr;
-
+
/* FIXME: type is default */
zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
/* Create a zend_copy_str_tolower(dest, src, src_length); */
lc_method_name = zend_u_str_case_fold(type, method_name, method_len, 1, &lc_method_name_len);
-
+
zobj = Z_OBJ_P(object);
if (zend_u_hash_find(&zobj->ce->function_table, type, lc_method_name, lc_method_name_len+1, (void **)&fbc) == FAILURE) {
efree(lc_method_name);
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
- updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC);
+ updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC);
if (!updated_fbc) {
zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : (char*)EMPTY_STR);
}
zend_error(E_ERROR, "Access to undeclared static property: %v::$%R", ce->name, type, property_name);
}
}
-
+
return retval;
}
static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC)
{
zend_object *zobj1, *zobj2;
-
+
zobj1 = Z_OBJ_P(o1);
zobj2 = Z_OBJ_P(o2);
zval **value;
zval *tmp_member = NULL;
zend_property_info *property_info;
-
+
zobj = Z_OBJ_P(object);
if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Read object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member));
-#endif
+#endif
property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC);
zend_objects_store_add_ref, /* add_ref */
zend_objects_store_del_ref, /* del_ref */
zend_objects_clone_obj, /* clone_obj */
-
+
zend_std_read_property, /* read_property */
zend_std_write_property, /* write_property */
zend_std_read_dimension, /* read_dimension */
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
if (destructor) {
zval zobj, *obj = &zobj;
zval *old_exception;
-
+
if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) {
if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
if (object->ce != EG(scope)) {
zend_class_entry *ce = object->ce;
- zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
- "Call to private %v::__destruct() from context '%v'%s",
- ce->name,
- EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
+ zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+ "Call to private %v::__destruct() from context '%v'%s",
+ ce->name,
+ EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
EG(in_execution) ? "" : " during shutdown ignored");
return;
}
if (!zend_check_protected(destructor->common.scope, EG(scope))) {
zend_class_entry *ce = object->ce;
- zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
- "Call to protected %v::__destruct() from context '%v'%s",
- ce->name,
- EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
+ zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+ "Call to protected %v::__destruct() from context '%v'%s",
+ ce->name,
+ EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
EG(in_execution) ? "" : " during shutdown ignored");
return;
}
{
if (object->guards) {
zend_hash_destroy(object->guards);
- FREE_HASHTABLE(object->guards);
+ FREE_HASHTABLE(object->guards);
}
zend_hash_destroy(object->properties);
FREE_HASHTABLE(object->properties);
}
ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC)
-{
+{
zend_object_value retval;
*object = emalloc(sizeof(zend_object));
zend_object *new_object;
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
- /* assume that create isn't overwritten, so when clone depends on the
+ /* assume that create isn't overwritten, so when clone depends on the
* overwritten one then it must itself be overwritten */
old_object = zend_objects_get_address(zobject TSRMLS_CC);
new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC);
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
{
zend_object_handle handle;
struct _store_object *obj;
-
+
if (EG(objects_store).free_list_head != -1) {
handle = EG(objects_store).free_list_head;
EG(objects_store).free_list_head = EG(objects_store).object_buckets[handle].bucket.free_list.next;
{
zend_object_handle handle;
struct _store_object *obj;
-
+
if (!EG(objects_store).object_buckets) {
return;
}
handle = Z_OBJ_HANDLE_P(zobject);
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
-
+
/* Make sure we hold a reference count during the destructor call
otherwise, when the destructor ends the storage might be freed
when the refcount reaches 0 a second time
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
-
+
if (obj->clone == NULL) {
zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %v", Z_OBJCE_P(zobject)->name);
- }
+ }
obj->clone(obj->object, &new_object TSRMLS_CC);
retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC);
retval.handlers = Z_OBJ_HT_P(zobject);
-
+
return retval;
}
Z_TYPE_P(retval) = IS_OBJECT;
Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, NULL, (zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, (zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC);
Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers;
-
+
return retval;
}
static zend_object_handlers zend_object_proxy_handlers = {
ZEND_OBJECTS_STORE_HANDLERS,
-
+
NULL, /* read_property */
NULL, /* write_property */
NULL, /* read dimension */
-/*
+/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
{
if (function->type == ZEND_USER_FUNCTION) {
zend_cleanup_op_array_data((zend_op_array *) function);
- }
+ }
return 0;
}
ZEND_API void destroy_zend_class(zend_class_entry **pce)
{
zend_class_entry *ce = *pce;
-
+
if (--ce->refcount > 0) {
return;
}
op_array->size *= 4;
op_array_alloc_ops(op_array);
}
-
+
next_op = &(op_array->opcodes[next_op_num]);
-
+
init_op(next_op TSRMLS_CC);
return next_op;
ZEND_VM_SET_OPCODE_HANDLER(opline);
opline++;
}
-
+
op_array->done_pass_two = 1;
return 0;
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
{
double retval = 1.0;
TSRMLS_FETCH();
-
+
convert_object_to_type(op, IS_DOUBLE, convert_to_double);
if (Z_TYPE_P(op) == IS_DOUBLE) {
zval_dtor(op);
ZVAL_DOUBLE(op, retval);
break;
- }
+ }
default:
zend_error(E_WARNING, "Cannot convert to real value (type=%d)", Z_TYPE_P(op));
zval_dtor(op);
if (Z_TYPE_P(op) == IS_BOOL) {
return;
}
-
+
if (EG(ze1_compatibility_mode)) {
HashTable *ht = Z_OBJPROP_P(op);
if (ht) {
retval = (zend_hash_num_elements(ht)?1:0);
}
}
-
+
zval_dtor(op);
ZVAL_BOOL(op, retval);
break;
int32_t capacity;
double dval = Z_DVAL_P(op);
TSRMLS_FETCH();
-
+
capacity = MAX_LENGTH_OF_DOUBLE + EG(precision) + 1;
Z_USTRVAL_P(op) = eumalloc_rel(capacity);
Z_USTRLEN_P(op) = u_sprintf(Z_USTRVAL_P(op), "%.*G", (int) EG(precision), dval);
break;
case IS_OBJECT: {
TSRMLS_FETCH();
-
+
convert_object_to_type(op, IS_UNICODE, convert_to_unicode);
if (Z_TYPE_P(op) == IS_UNICODE) {
break;
case IS_OBJECT: {
TSRMLS_FETCH();
-
+
convert_object_to_type(op, IS_STRING, convert_to_string);
if (Z_TYPE_P(op) == IS_STRING) {
static void convert_scalar_to_array(zval *op, int type TSRMLS_DC)
{
zval *entry;
-
+
ALLOC_ZVAL(entry);
*entry = *op;
INIT_PZVAL(entry);
-
+
switch (type) {
case IS_ARRAY:
ALLOC_HASHTABLE(Z_ARRVAL_P(op));
{
zval **arg;
va_list ap;
-
+
va_start(ap, argc);
while (argc--) {
arg = va_arg(ap, zval **);
convert_to_long_ex(arg);
}
-
+
va_end(ap);
}
{
zval **arg;
va_list ap;
-
+
va_start(ap, argc);
- while (argc--) {
+ while (argc--) {
arg = va_arg(ap, zval **);
convert_to_double_ex(arg);
}
-
+
va_end(ap);
}
{
zval **arg;
va_list ap;
-
+
va_start(ap, argc);
- while (argc--) {
+ while (argc--) {
arg = va_arg(ap, zval **);
convert_to_string_ex(arg);
}
-
+
va_end(ap);
}
if (Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) {
long lval = Z_LVAL_P(op1) + Z_LVAL_P(op2);
-
+
/* check for overflow by comparing sign bits */
- if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
+ if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
if (Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) {
long lval = Z_LVAL_P(op1) - Z_LVAL_P(op2);
-
+
/* check for overflow by comparing sign bits */
- if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK)
+ if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2);
ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
long overflow;
ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result),overflow);
- Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
+ Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
return SUCCESS;
}
if ((Z_TYPE_P(op1) == IS_DOUBLE && Z_TYPE_P(op2) == IS_LONG)
ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
zendi_convert_to_long(op1, op1_copy, result);
zendi_convert_to_long(op2, op2_copy, result);
ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
Z_TYPE_P(result) = IS_BOOL;
zendi_convert_to_boolean(op1, op1_copy, result);
ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC)
{
zval op1_copy;
-
+
zendi_convert_to_boolean(op1, op1_copy, result);
Z_TYPE_P(result) = IS_BOOL;
ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC)
{
zval op1_copy = *op1;
-
+
op1 = &op1_copy;
-
+
if (Z_TYPE_P(op1) == IS_DOUBLE) {
Z_LVAL_P(op1) = (long) Z_DVAL_P(op1);
Z_TYPE_P(op1) = IS_LONG;
ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) {
zval *longer, *shorter;
char *result_str;
Z_STRLEN_P(result) = result_len;
return SUCCESS;
}
-
+
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
zend_error(E_ERROR, "Unsupported operand types");
return FAILURE;
ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) {
zval *longer, *shorter;
char *result_str;
}
zendi_convert_to_long(op1, op1_copy, result);
- zendi_convert_to_long(op2, op2_copy, result);
+ zendi_convert_to_long(op2, op2_copy, result);
Z_TYPE_P(result) = IS_LONG;
Z_LVAL_P(result) = Z_LVAL_P(op1) ^ Z_LVAL_P(op2);
ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
zend_error(E_ERROR, "Unsupported operand types");
return FAILURE;
ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
-
+
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
zend_error(E_ERROR, "Unsupported operand types");
return FAILURE;
zval *op1_free, *op2_free;
int op1_obj = Z_TYPE_P(op1) == IS_OBJECT;
int op2_obj = Z_TYPE_P(op2) == IS_OBJECT;
-
+
if (op1_obj) {
if (Z_OBJ_HT_P(op1)->get) {
op1 = op1_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC);
COMPARE_RETURN_AND_FREE(SUCCESS);
}
}
-
- if ((Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op1) == IS_STRING) &&
+
+ if ((Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op1) == IS_STRING) &&
(Z_TYPE_P(op2) == IS_UNICODE || Z_TYPE_P(op2) == IS_STRING)) {
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
char *t;
int last=0; /* Shut up the compiler warning */
int ch;
-
+
if (Z_STRLEN_P(str) == 0) {
STR_FREE(Z_STRVAL_P(str));
Z_STRVAL_P(str) = estrndup("1", sizeof("1")-1);
ZVAL_DOUBLE(op1, d+1);
} else {
Z_LVAL_P(op1)++;
- }
+ }
break;
case IS_DOUBLE:
Z_DVAL_P(op1) = Z_DVAL_P(op1) + 1;
{
long lval;
double dval;
-
+
switch (Z_TYPE_P(op1)) {
case IS_LONG:
if (Z_LVAL_P(op1) == LONG_MIN) {
return dest;
}
-
+
ZEND_API char *zend_str_tolower_dup(const char *source, unsigned int length)
{
return zend_str_tolower_copy((char *)emalloc(length+1), source, length);
return zend_str_tolower_copy(dest, source, length);
}
}
-
+
ZEND_API void *zend_u_str_tolower_dup(zend_uchar type, const void *source, unsigned int length)
{
if (type == IS_UNICODE) {
ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2)
{
int retval;
-
+
retval = memcmp(s1, s2, MIN(len1, len2));
if (!retval) {
return (len1 - len2);
ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length)
{
int retval;
-
+
retval = memcmp(s1, s2, MIN(length, MIN(len1, len2)));
if (!retval) {
return (MIN(length, len1) - MIN(length, len2));
int ret1, ret2;
long lval1, lval2;
double dval1, dval2;
-
+
if ((ret1=is_numeric_string(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0)) &&
(ret2=is_numeric_string(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0))) {
if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
Z_LVAL_P(result) = ZEND_NORMALIZE_BOOL(Z_LVAL_P(result));
Z_TYPE_P(result) = IS_LONG;
}
- return;
+ return;
}
double dval1, dval2;
zval s1_copy, s2_copy;
int use_copy1 = 0, use_copy2 = 0;
-
+
if (Z_TYPE_P(s1) != IS_UNICODE || Z_TYPE_P(s2) != IS_UNICODE) {
zend_make_unicode_zval(s1, &s1_copy, &use_copy1);
zend_make_unicode_zval(s2, &s2_copy, &use_copy2);
if (use_copy2) {
zval_dtor(s2);
}
- return;
+ return;
}
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC)
{
double dval = Z_DVAL_P(op);
-
+
TSRMLS_FETCH();
-
+
Z_STRVAL_P(op) = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
sprintf(Z_STRVAL_P(op), "%.*G", (int) EG(precision), dval);
Z_STRLEN_P(op) = strlen(Z_STRVAL_P(op));
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
if (!length) {
return 0;
}
-
+
/* handle hex numbers */
if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
conv_base=16;
if (!length) {
return 0;
}
-
+
/* handle hex numbers */
if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
conv_base=16;
return p;
}
}
-
+
if (p == NULL) {
return NULL;
}
-
+
p++;
}
-
+
return NULL;
}
#define Z_OBJVAL_P(zval_p) Z_OBJVAL(*zval_p)
#define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*zval_p)
#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*zval_p)
-#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h)
+#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h)
#define Z_UNIVAL_P(zval_p) Z_UNIVAL(*zval_p)
#define Z_UNILEN_P(zval_p) Z_UNILEN(*zval_p)
#define Z_OBJVAL_PP(zval_pp) Z_OBJVAL(**zval_pp)
#define Z_OBJ_HANDLE_PP(zval_p) Z_OBJ_HANDLE(**zval_p)
#define Z_OBJ_HT_PP(zval_p) Z_OBJ_HT(**zval_p)
-#define Z_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h)
+#define Z_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h)
#define Z_UNIVAL_PP(zval_pp) Z_UNIVAL(**zval_pp)
#define Z_UNILEN_PP(zval_pp) Z_UNILEN(**zval_pp)
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
{
va_list ptr;
void *elem;
-
+
ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count)
va_start(ptr, count);
{
va_list ptr;
void **elem;
-
+
va_start(ptr, count);
while (count>0) {
elem = va_arg(ptr, void **);
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
for (; seg2 >= seg1 && compare(seg2, begin TSRMLS_CC) > 0;
seg2 -= siz);
-
+
if (seg1 >= seg2)
break;
-
+
_zend_qsort_swap(seg1, seg2, siz);
seg1 += siz;
_zend_qsort_swap(begin, seg2, siz);
seg2p = seg2;
-
+
if ((seg2p - begin) <= (end - seg2p)) {
if ((seg2p + siz) < end) {
begin_stack[loop] = seg2p + siz;
}
}
-/*
+/*
* Local Variables:
- * c-basic-offset: 4
+ * c-basic-offset: 4
* tab-width: 4
* End:
* vim600: fdm=marker
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
handle->handle.fp = zend_fopen(filename, &handle->opened_path);
handle->filename = (char *)filename;
handle->free_filename = 0;
-
+
return (handle->handle.fp) ? SUCCESS : FAILURE;
}
return FAILURE;
}
break;
-
+
case ZEND_HANDLE_FD:
file_handle->handle.fp = fdopen(file_handle->handle.fd, "rb");
file_handle->type = ZEND_HANDLE_FP;
break;
-
+
case ZEND_HANDLE_FP:
file_handle->handle.fp = file_handle->handle.fp;
break;
-
+
case ZEND_HANDLE_STREAM:
/* nothing to do */
return SUCCESS;
-
+
default:
return FAILURE;
}
{
if (file_handle->handle.stream.interactive) {
int c = '*';
- size_t n;
+ size_t n;
#ifdef NETWARE
/*
*/
for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n )
#else
- for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n )
+ for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n )
#endif
- buf[n] = (char) c;
+ buf[n] = (char) c;
if ( c == '\n' )
- buf[n++] = (char) c;
+ buf[n++] = (char) c;
return n;
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
#define zend_stream_close(handle) zend_file_handle_dtor((handle))
#endif
-
if (se)
*se = (char *)s;
result = sign ? -value(rv) : value(rv);
-
+
for (i = 0; i <= Kmax; i++) {
Bigint **listp = &freelist[i];
while ((tmp = *listp) != NULL) {
}
freelist[i] = NULL;
}
-
+
while (p5s) {
tmp = p5s;
p5s = p5s->next;
free(tmp);
}
-
+
return result;
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
{
return;
}
-
+
*err = U_ZERO_ERROR;
//ucnv_cbFromUWriteSub(fromArgs, 0, err);
return;
} else if (*((char*)context)=='i') {
if (reason != UCNV_UNASSIGNED)
{
- /* the caller must have set
+ /* the caller must have set
* the error code accordingly
*/
return;
}
/*
- * If encoding is NULL, ucnv_open() will return a converter based on
+ * If encoding is NULL, ucnv_open() will return a converter based on
* the default platform encoding as determined by ucnv_getDefaultName().
*/
new_converter = ucnv_open(encoding, &status);
if (U_FAILURE(*status)) {
return;
}
-
+
null_size = ucnv_getMinCharSize(target_conv);
allocated = source_len + null_size;
for (i = 0; i < ident_len; ) {
U16_NEXT(ident, i, ident_len, codepoint);
- if (!u_hasBinaryProperty(codepoint, id_prop) &&
+ if (!u_hasBinaryProperty(codepoint, id_prop) &&
codepoint != 0x5f) { /* special case for starting '_' */
return 0;
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
}
}
-ZEND_API int zend_print_variable(zval *var)
+ZEND_API int zend_print_variable(zval *var)
{
return zend_print_zval(var, 0);
}
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
- | that is bundled with this package in the file LICENSE, and is |
+ | that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
zend_free_op free_op1, free_op2;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (OP2_TYPE == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
if (OP2_TYPE == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ opline->extended_value == ZEND_RETURNS_FUNCTION &&
!EX_T(opline->op2.u.var).var.fcall_returned_reference) {
if (free_op2.var == NULL) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
- zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
+ zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
- varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) ||
+ varptr != &EG(uninitialized_zval) &&
+ (PZVAL_IS_REF(varptr) ||
(varptr->refcount == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
SELECTIVE_PZVAL_LOCK(object_zval, &opline->result);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr = object_zval;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline);
/* We are not handling overloaded classes right now */
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) {
- zend_execute_data *ex = EXECUTE_DATA;
+ zend_execute_data *ex = EXECUTE_DATA;
ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1);
do {
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
{
zend_op *opline = EX(opline);
-
+
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
}
-
+
if (EG(error_reporting)) {
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
}
zendi_zval_dtor(restored_error_reporting);
}
EX(old_error_reporting) = NULL;
-
+
if (encapsulating_block == -1) {
ZEND_VM_RETURN_FROM_EXECUTE_LOOP();
} else {
}
ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
-{
+{
int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL);
switch (ret) {
*/
EX(function_state).function_symbol_table = NULL;
#endif
-
+
while (1) {
#ifdef ZEND_WIN32
if (EG(timed_out)) {
ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
- zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
+ zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
SELECTIVE_PZVAL_LOCK(object_zval, &opline->result);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr = object_zval;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline);
/* We are not handling overloaded classes right now */
static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
}
-
+
if (EG(error_reporting)) {
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
}
zendi_zval_dtor(restored_error_reporting);
}
EX(old_error_reporting) = NULL;
-
+
if (encapsulating_block == -1) {
ZEND_VM_RETURN_FROM_EXECUTE_LOOP();
} else {
}
static int ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
-{
+{
int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL);
switch (ret) {
{
zend_op *opline = EX(opline);
zval *class_name;
-
+
if (IS_CONST == IS_UNUSED) {
char *function_name_strval;
unsigned int function_name_strlen;
zend_bool is_const = (IS_CONST == IS_CONST);
-
+
if (is_const) {
function_name_strval = Z_UNIVAL(opline->op2.u.constant);
zend_function *function;
void *function_name_strval, *lcname;
unsigned int function_name_strlen, lcname_len;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
{
zend_op *opline = EX(opline);
zval *class_name;
-
+
if (IS_UNUSED == IS_UNUSED) {
char *function_name_strval;
unsigned int function_name_strlen;
zend_bool is_const = (IS_UNUSED == IS_CONST);
-
+
if (is_const) {
function_name_strval = Z_UNIVAL(opline->op2.u.constant);
{
zend_op *opline = EX(opline);
zval *class_name;
-
+
if (IS_CV == IS_UNUSED) {
char *function_name_strval;
unsigned int function_name_strlen;
zend_bool is_const = (IS_CV == IS_CONST);
-
+
if (is_const) {
function_name_strval = Z_UNIVAL(opline->op2.u.constant);
zend_function *function;
void *function_name_strval, *lcname;
unsigned int function_name_strlen, lcname_len;
-
+
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
static int ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant TSRMLS_CC);
static int ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
boolean_not_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant TSRMLS_CC);
static int ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *z = &opline->op1.u.constant;
UErrorCode status = U_ZERO_ERROR;
static int ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int ret = i_zend_is_true(&opline->op1.u.constant);
if (!ret) {
static int ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int ret = i_zend_is_true(&opline->op1.u.constant);
if (ret) {
static int ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int retval = i_zend_is_true(&opline->op1.u.constant);
if (retval) {
static int ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int retval = i_zend_is_true(&opline->op1.u.constant);
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
static int ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int retval = i_zend_is_true(&opline->op1.u.constant);
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
static int ZEND_DO_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *fname = &opline->op1.u.constant;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), NULL);
zend_op *opline = EX(opline);
zval *retval_ptr;
zval **retval_ptr_ptr;
-
+
if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) {
zend_op *opline = EX(opline);
zval *value;
zval *exception;
-
+
value = &opline->op1.u.constant;
{
zval *valptr;
zval *value;
-
+
value = &opline->op1.u.constant;
static int ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(&opline->op1.u.constant);
static int ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *obj = &opline->op1.u.constant;
zend_class_entry *ce;
zend_function *clone;
static int ZEND_CAST_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *expr = &opline->op1.u.constant;
zval *result = &EX_T(opline->result.u.var).tmp_var;
zend_op_array *new_op_array=NULL;
zval **original_return_value = EG(return_value_ptr_ptr);
int return_value_used;
-
+
zval *inc_filename = &opline->op1.u.constant;
zval tmp_inc_filename;
zend_bool failure_retval=0;
zend_op *opline = EX(opline);
zval tmp, *varname;
HashTable *target_symbol_table;
-
+
varname = &opline->op1.u.constant;
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1);
do {
static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr, **array_ptr_ptr;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval tmp, *varname = &opline->op1.u.constant;
zval **value;
zend_bool isset = 1;
{
if (IS_CONST != IS_UNUSED) {
zend_op *opline = EX(opline);
-
+
zval *ptr = &opline->op1.u.constant;
if (Z_TYPE_P(ptr) == IS_LONG) {
static int ZEND_QM_ASSIGN_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *value = &opline->op1.u.constant;
EX_T(opline->result.u.var).tmp_var = *value;
static int ZEND_U_NORMALIZE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *string = &opline->op1.u.constant;
zval *result = &EX_T(opline->result.u.var).tmp_var;
static int ZEND_ADD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
add_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_SUB_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
sub_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_MUL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mul_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_DIV_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
div_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_MOD_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mod_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_SL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_left_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_SR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_right_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_CONCAT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
concat_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_identical_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_identical_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_equal_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_equal_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BW_OR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BW_AND_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BW_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BOOL_XOR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
{
zend_op *opline = EX(opline);
int switch_expr_is_overloaded=0;
-
+
if (IS_CONST==IS_VAR) {
if (EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=&opline->op2.u.constant;
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=NULL;
static int ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
add_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
sub_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mul_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
div_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mod_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_left_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_right_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_CONCAT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
concat_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_identical_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_identical_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_equal_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_equal_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_SMALLER_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BW_AND_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
static int ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
&opline->op1.u.constant,
{
zend_op *opline = EX(opline);
int switch_expr_is_overloaded=0;
-
+
if (IS_CONST==IS_VAR) {
if (EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1);
do {
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr);
}
} else {
-
+
zval *dim = &opline->op2.u.constant;
EX_T(opline->result.u.var).var.ptr_ptr = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, BP_VAR_R TSRMLS_CC);
varptr = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
- varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) ||
+ varptr != &EG(uninitialized_zval) &&
+ (PZVAL_IS_REF(varptr) ||
(varptr->refcount == 1 && (IS_VAR == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1);
do {
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
zend_free_op free_op1;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_CONST == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
} else {
-
+
zval *offset = &opline->op2.u.constant;
if (0) {
static int ZEND_ASSIGN_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *value = &opline->op2.u.constant;
zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC);
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
long index;
if (container) {
-
+
zval *offset = &opline->op2.u.constant;
if (Z_TYPE_PP(container) == IS_ARRAY) {
zend_free_op free_op1, free_op2;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
zend_free_op free_op1, free_op2;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_VAR == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
if (IS_VAR == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ opline->extended_value == ZEND_RETURNS_FUNCTION &&
!EX_T(opline->op2.u.var).var.fcall_returned_reference) {
if (free_op2.var == NULL) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
zend_free_op free_op1;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
zend_free_op free_op1;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_CV == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
} else {
-
+
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (0) {
static int ZEND_ASSIGN_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC);
if (IS_CV == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ opline->extended_value == ZEND_RETURNS_FUNCTION &&
!EX_T(opline->op2.u.var).var.fcall_returned_reference) {
if (free_op2.var == NULL) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
long index;
if (container) {
-
+
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (Z_TYPE_PP(container) == IS_ARRAY) {
static int ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *obj = _get_obj_zval_ptr_unused(TSRMLS_C);
zend_class_entry *ce;
zend_function *clone;
{
if (IS_UNUSED != IS_UNUSED) {
zend_op *opline = EX(opline);
-
+
zval *ptr = NULL;
if (Z_TYPE_P(ptr) == IS_LONG) {
static int zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *object;
zval *property = &opline->op2.u.constant;
static int zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *object;
zval *property = &opline->op2.u.constant;
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
} else {
-
+
zval *offset = &opline->op2.u.constant;
if (0) {
static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = &opline->op2.u.constant;
if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) {
static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = &opline->op2.u.constant;
if (0) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
-
+
zval *property = &opline->op2.u.constant;
if (0) {
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
zval *function_name;
char *function_name_strval;
int function_name_strlen;
-
+
/* FIXME: type is default */
zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=&opline->op2.u.constant;
static int ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = &opline->op2.u.constant;
long index;
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = &opline->op2.u.constant;
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval **value = NULL;
int result = 0;
long index;
if (container) {
-
+
zval *offset = &opline->op2.u.constant;
if (Z_TYPE_PP(container) == IS_ARRAY) {
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval **value = NULL;
int result = 0;
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval **value = NULL;
int result = 0;
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=NULL;
static int zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *object;
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
static int zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *object;
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
} else {
-
+
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (0) {
static int ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_UNUSED != IS_CV) {
static int ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (0) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
-
+
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (0) {
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_UNUSED == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
zval *function_name;
char *function_name_strval;
int function_name_strlen;
-
+
/* FIXME: type is default */
zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
static int ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
long index;
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
zval **value = NULL;
int result = 0;
long index;
if (container) {
-
+
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (Z_TYPE_PP(container) == IS_ARRAY) {
static int ZEND_BW_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_not_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
static int ZEND_BOOL_NOT_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
boolean_not_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC) TSRMLS_CC);
static int ZEND_PRE_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC);
if (!var_ptr) {
static int ZEND_PRE_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC);
if (!var_ptr) {
static int ZEND_POST_INC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC);
if (!var_ptr) {
static int ZEND_POST_DEC_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **var_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC);
if (!var_ptr) {
static int ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
UErrorCode status = U_ZERO_ERROR;
static int ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC));
if (!ret) {
static int ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int ret = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC));
if (ret) {
static int ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC));
if (retval) {
static int ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC));
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
static int ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int retval = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC));
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = retval;
zend_op *opline = EX(opline);
zval *retval_ptr;
zval **retval_ptr_ptr;
-
+
if (EG(active_op_array)->return_reference == ZEND_RETURN_REF) {
zend_op *opline = EX(opline);
zval *value;
zval *exception;
-
+
value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
{
zval *valptr;
zval *value;
-
+
value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
{
zend_op *opline = EX(opline);
zval *varptr;
-
+
varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
if (varptr == &EG(uninitialized_zval)) {
varptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
- varptr != &EG(uninitialized_zval) &&
- (PZVAL_IS_REF(varptr) ||
+ varptr != &EG(uninitialized_zval) &&
+ (PZVAL_IS_REF(varptr) ||
(varptr->refcount == 1 && (IS_CV == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
static int ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **varptr_ptr;
zval *varptr;
varptr_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
static int ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = i_zend_is_true(_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC));
static int ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *obj = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_class_entry *ce;
zend_function *clone;
static int ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *result = &EX_T(opline->result.u.var).tmp_var;
zend_op_array *new_op_array=NULL;
zval **original_return_value = EG(return_value_ptr_ptr);
int return_value_used;
-
+
zval *inc_filename = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zval tmp_inc_filename;
zend_bool failure_retval=0;
zend_op *opline = EX(opline);
zval tmp, *varname;
HashTable *target_symbol_table;
-
+
varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC);
} else {
- target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
+ target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) {
- zend_execute_data *ex = execute_data;
+ zend_execute_data *ex = execute_data;
ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1);
do {
static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr, **array_ptr_ptr;
HashTable *fe_ht;
zend_object_iterator *iter = NULL;
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
-
+
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
static int ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval tmp, *varname = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC);
zval **value;
zend_bool isset = 1;
{
if (IS_CV != IS_UNUSED) {
zend_op *opline = EX(opline);
-
+
zval *ptr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
if (Z_TYPE_P(ptr) == IS_LONG) {
static int ZEND_QM_ASSIGN_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *value = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
EX_T(opline->result.u.var).tmp_var = *value;
static int ZEND_INSTANCEOF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *expr = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_bool result;
static int ZEND_U_NORMALIZE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *string = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *result = &EX_T(opline->result.u.var).tmp_var;
static int ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
add_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
sub_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mul_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
div_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mod_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_left_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_right_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_CONCAT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
concat_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_identical_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_identical_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_equal_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_equal_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_SMALLER_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BW_AND_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zval *object;
zval *property = &opline->op2.u.constant;
static int zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zval *object;
zval *property = &opline->op2.u.constant;
static int ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = &opline->op2.u.constant;
if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) {
static int ZEND_FETCH_DIM_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = &opline->op2.u.constant;
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC);
static int ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = &opline->op2.u.constant;
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC);
static int ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = &opline->op2.u.constant;
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC);
static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_CONST == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *dim = &opline->op2.u.constant;
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
} else {
-
+
zval *offset = &opline->op2.u.constant;
if (0) {
static int ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = &opline->op2.u.constant;
if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) {
static int ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = &opline->op2.u.constant;
if (0) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
-
+
zval *property = &opline->op2.u.constant;
if (0) {
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ASSIGN_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *value = &opline->op2.u.constant;
zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CONST), EX(Ts) TSRMLS_CC);
zval *function_name;
char *function_name_strval;
int function_name_strlen;
-
+
/* FIXME: type is default */
zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
{
zend_op *opline = EX(opline);
int switch_expr_is_overloaded=0;
-
+
if (IS_CV==IS_VAR) {
if (EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=&opline->op2.u.constant;
static int ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = &opline->op2.u.constant;
long index;
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = &opline->op2.u.constant;
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC);
zval **value = NULL;
int result = 0;
long index;
if (container) {
-
+
zval *offset = &opline->op2.u.constant;
if (Z_TYPE_PP(container) == IS_ARRAY) {
zend_free_op free_op2;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_TMP_VAR == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC);
zval **value = NULL;
int result = 0;
zend_free_op free_op2;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_VAR == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
if (IS_VAR == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ opline->extended_value == ZEND_RETURNS_FUNCTION &&
!EX_T(opline->op2.u.var).var.fcall_returned_reference) {
if (free_op2.var == NULL) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC);
zval **value = NULL;
int result = 0;
static int ZEND_FETCH_DIM_W_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = NULL;
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC);
static int ZEND_FETCH_DIM_RW_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = NULL;
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC);
static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_UNUSED == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=NULL;
static int ZEND_ADD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
add_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_SUB_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
sub_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_MUL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mul_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_DIV_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
div_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_MOD_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
mod_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_SL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_left_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_SR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
shift_right_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_CONCAT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
concat_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_identical_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_identical_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_equal_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_NOT_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_not_equal_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_SMALLER_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
is_smaller_or_equal_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BW_OR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_or_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BW_AND_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_and_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BW_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
bitwise_xor_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int ZEND_BOOL_XOR_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
boolean_xor_function(&EX_T(opline->result.u.var).tmp_var,
_get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC),
static int zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zval *object;
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
static int zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t incdec_op, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zval *object;
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
static int ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) {
static int ZEND_FETCH_DIM_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC), dim, 0, BP_VAR_W TSRMLS_CC);
static int ZEND_FETCH_DIM_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_RW TSRMLS_CC), dim, 0, BP_VAR_RW TSRMLS_CC);
static int ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_fetch_dimension_address(RETURN_VALUE_UNUSED(&opline->result)?NULL:&EX_T(opline->result.u.var), _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC), dim, 0, BP_VAR_IS TSRMLS_CC);
static int ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
-
+
if (IS_CV == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
static int ZEND_FETCH_DIM_UNSET_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *dim = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_op *opline = EX(opline);
zval *container;
zval **retval;
-
+
retval = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr_ptr = retval;
SELECTIVE_PZVAL_LOCK(*retval, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
} else {
-
+
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (0) {
static int ZEND_FETCH_OBJ_W_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (opline->extended_value == ZEND_FETCH_ADD_LOCK && IS_CV != IS_CV) {
static int ZEND_FETCH_OBJ_RW_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (0) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)) {
/* Behave like FETCH_OBJ_W */
-
+
zval *property = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (0) {
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_W TSRMLS_CC);
zend_assign_to_object(&opline->result, object_ptr, &opline->op2, &op_data->op1, EX(Ts), ZEND_ASSIGN_OBJ TSRMLS_CC);
{
zend_op *opline = EX(opline);
zend_op *op_data = opline+1;
-
+
zval **object_ptr;
if (IS_CV == IS_CV || EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ASSIGN_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *value = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
zend_assign_to_variable(&opline->result, &opline->op1, &opline->op2, value, (0?IS_TMP_VAR:IS_CV), EX(Ts) TSRMLS_CC);
if (IS_CV == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
- opline->extended_value == ZEND_RETURNS_FUNCTION &&
+ opline->extended_value == ZEND_RETURNS_FUNCTION &&
!EX_T(opline->op2.u.var).var.fcall_returned_reference) {
if (free_op2.var == NULL) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
zval *function_name;
char *function_name_strval;
int function_name_strlen;
-
+
/* FIXME: type is default */
zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
{
zend_op *opline = EX(opline);
int switch_expr_is_overloaded=0;
-
+
if (IS_CV==IS_VAR) {
if (EX_T(opline->op1.u.var).var.ptr_ptr) {
static int ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval *array_ptr = &EX_T(opline->result.u.var).tmp_var;
zval *expr_ptr, **expr_ptr_ptr = NULL;
zval *offset=_get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
static int ZEND_UNSET_DIM_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
long index;
free_offset = 1;
}
}
-
+
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
static int ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_UNSET TSRMLS_CC);
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
static int zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
-
+
zval **container = _get_zval_ptr_ptr_cv(&opline->op1, EX(Ts), BP_VAR_IS TSRMLS_CC);
zval **value = NULL;
int result = 0;
long index;
if (container) {
-
+
zval *offset = _get_zval_ptr_cv(&opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
if (Z_TYPE_PP(container) == IS_ARRAY) {
*/
EX(function_state).function_symbol_table = NULL;
#endif
-
+
while (1) {
{%ZEND_VM_CONTINUE_LABEL%}
#ifdef ZEND_WIN32
/* Remove unnecessary ';' */
$code = preg_replace('/^\s*;\s*$/m', '', $code);
+ /* Remove WS */
+ $code = preg_replace('/[ \t]+\n/m', "\n", $code);
+
out($f, $code);
}
// Try to use unspecialized handler
$op2 = "ANY";
}
- // Check if specialized handler is defined
+ // Check if specialized handler is defined
if (isset($dsc["op1"][$op1]) &&
isset($dsc["op2"][$op2])) {
// Emit pointer to specialized handler
function gen_null_handler($f) {
static $done = 0;
- // New and all executors with CALL threading model can use the same handler
+ // New and all executors with CALL threading model can use the same handler
// for undefined opcodes, do we emit code for it only once
if (!$done) {
$done = 1;
if ($spec) {
// Produce specialized executor
$op1t = $op_types;
- // for each op1.op_type
+ // for each op1.op_type
foreach($op1t as $op1) {
$op2t = $op_types;
- // for each op2.op_type
+ // for each op2.op_type
foreach($op2t as $op2) {
// for each handlers in helpers in original order
foreach ($list as $lineno => $dsc) {
$code_len = strlen((string)$max_opcode);
$f = fopen("zend_vm_opcodes.h", "w+") or die("ERROR: Cannot create zend_vm_opcodes.h\n");
- // Insert header
+ // Insert header
out($f, $GLOBALS['header_text']);
foreach ($opcodes as $code => $dsc) {
$f = fopen("zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n");
$executor_file = realpath("zend_vm_execute.h");
- // Insert header
+ // Insert header
out($f, $GLOBALS['header_text']);
// Support for ZEND_USER_OPCODE
out($f, "}\n\n");
// Export handlers and helpers
- if (count($export) > 0 &&
- !ZEND_VM_OLD_EXECUTOR &&
+ if (count($export) > 0 &&
+ !ZEND_VM_OLD_EXECUTOR &&
ZEND_VM_KIND != ZEND_VM_KIND_CALL) {
out($f,"#undef EX\n");
out($f,"#define EX(element) execute_data->element\n\n");