diff options
Diffstat (limited to 'ext/spl/spl_engine.c')
| -rw-r--r-- | ext/spl/spl_engine.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c index c07ce6846f..a2f3653432 100644 --- a/ext/spl/spl_engine.c +++ b/ext/spl/spl_engine.c @@ -32,14 +32,11 @@ #include "spl_array.h" /* {{{ spl_instantiate */ -PHPAPI void spl_instantiate(zend_class_entry *pce, zval **object, int alloc TSRMLS_DC) +PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC) { - if (alloc) { - ALLOC_ZVAL(*object); - } - object_init_ex(*object, pce); - Z_SET_REFCOUNT_PP(object, 1); - Z_SET_ISREF_PP(object); /* check if this can be hold always */ + object_init_ex(object, pce); + Z_SET_REFCOUNT_P(object, 1); + // !!!PZ_SET_ISREF_P(object); /* check if this can be hold always */ } /* }}} */ @@ -51,10 +48,14 @@ PHPAPI long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */ break; case IS_DOUBLE: return (long)Z_DVAL_P(offset); - case IS_RESOURCE: - case IS_BOOL: case IS_LONG: return Z_LVAL_P(offset); + case IS_FALSE: + return 0; + case IS_TRUE: + return 1; + case IS_RESOURCE: + return Z_RES_HANDLE_P(offset); } return -1; } |
