- extensions such as SimpleXML. This is for Sterling.
case IS_OBJECT:
if (expr->value.obj.handlers->cast_object) {
TSRMLS_FETCH();
- if (expr->value.obj.handlers->cast_object == zend_std_cast_object) {
+ /* Standard PHP objects */
+ if (expr->value.obj.handlers == &std_object_handlers) {
if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
break;
}
return FAILURE;
}
-int zend_std_cast_object(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
-{
- return FAILURE;
-}
ZEND_API zend_object_handlers std_object_handlers = {
zend_objects_store_add_ref, /* add_ref */
zend_std_object_get_class, /* get_class_entry */
zend_std_object_get_class_name, /* get_class_name */
zend_std_compare_objects, /* compare_objects */
- zend_std_cast_object, /* cast_object */
+ NULL, /* cast_object */
};
/*
ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *property_name, int property_name_len, zend_bool silent TSRMLS_DC);
ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, char *property_name, int property_name_len TSRMLS_DC);
-int zend_std_cast_object(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC);
ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC);
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
break; \
case IS_OBJECT: \
- (holder).value.lval = 1; /* TBI!! */ \
+ (holder) = (*(op)); \
+ zval_copy_ctor(&(holder)); \
+ convert_to_long(&(holder)); \
break; \
case IS_BOOL: \
case IS_RESOURCE: \
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
break; \
case IS_OBJECT: \
- (holder).value.lval = 1; /* TBI!! */ \
+ (holder) = (*(op)); \
+ zval_copy_ctor(&(holder)); \
+ convert_to_boolean(&(holder)); \
break; \
default: \
(holder).value.lval = 0; \