summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2001-08-16 14:04:04 +0000
committerAndi Gutmans <andi@php.net>2001-08-16 14:04:04 +0000
commitea48c0c46acc1d7ca6e9fb5cc078f0393b4e63ac (patch)
treef927a3dd4705d0ecb3a53021ac02b0a393755388 /Zend/zend_operators.c
parent351048297185f37175170cf3ac970bac94f915da (diff)
downloadphp-git-ea48c0c46acc1d7ca6e9fb5cc078f0393b4e63ac.tar.gz
- Fix a bug in method calls.
- Try to get the old copying behavior of objects to work (doesn't work yet).
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 42f0972600..a37fcc9066 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -514,10 +514,19 @@ ZEND_API void convert_to_array(zval *op)
case IS_ARRAY:
return;
break;
-/* OBJECTS_FIXME */
+/* OBJECTS_OPTIMIZE */
case IS_OBJECT:
- op->type = IS_ARRAY;
- op->value.ht = Z_OBJPROP_P(op);
+ {
+ zval *tmp;
+ HashTable *ht;
+
+ ALLOC_HASHTABLE(ht);
+ zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_hash_copy(ht, Z_OBJPROP_P(op), (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+ zval_dtor(op);
+ op->type = IS_ARRAY;
+ op->value.ht = ht;
+ }
return;
case IS_NULL:
ALLOC_HASHTABLE(op->value.ht);
@@ -1240,7 +1249,6 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
break;
case IS_OBJECT:
-/* OBJECTS_FIXME */
if (Z_OBJCE_P(op1) != Z_OBJCE_P(op2)) {
result->value.lval = 0;
} else {
@@ -1695,7 +1703,6 @@ ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC)
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC)
{
-/* OBJECTS_FIXME */
if (Z_OBJCE_P(o1) != Z_OBJCE_P(o2)) {
result->value.lval = 1; /* Comparing objects of different types is pretty much meaningless */
result->type = IS_LONG;