diff options
| author | Andi Gutmans <andi@php.net> | 2004-10-04 19:54:35 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2004-10-04 19:54:35 +0000 |
| commit | db507dd153fa668fef95863afee4d04f33b80b85 (patch) | |
| tree | 67ffc59fbd97a93c94e37ae6a8cb735b6755e221 /ext/spl | |
| parent | bb77132391aaeb07daa0e057ea5c11cdb151dfda (diff) | |
| download | php-git-db507dd153fa668fef95863afee4d04f33b80b85.tar.gz | |
- Commit the variable fetch optimization.
- Extensions which delete global variables need to use new special function
- delete_global_variable() (I'm about to rename it) to remove them.
- Will post to internals@ or via commit messages if there's anything else.
Diffstat (limited to 'ext/spl')
| -rwxr-xr-x | ext/spl/spl_array.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 34645a18ef..ecc1bc0a21 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -278,8 +278,14 @@ static void spl_array_unset_dimension(zval *object, zval *offset TSRMLS_DC) switch(Z_TYPE_P(offset)) { case IS_STRING: - if (zend_symtable_del(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) { - zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + if (HASH_OF(intern->array) == &EG(symbol_table)) { + if (delete_global_variable(Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC)) { + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + } + } else { + if (zend_symtable_del(HASH_OF(intern->array), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) { + zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset)); + } } return; case IS_DOUBLE: |
