diff options
author | Marcus Boerger <helly@php.net> | 2004-11-11 19:42:11 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-11-11 19:42:11 +0000 |
commit | 4c8bca469f9c577026e8fe5885d82c8c74b4b32c (patch) | |
tree | eacb802c1d1464a44ec4b36f5dbf8cb3598a09f9 /ext/spl/spl_array.c | |
parent | 9c0f5e88871e462b66d85b31be908a3249eaa15b (diff) | |
download | php-git-4c8bca469f9c577026e8fe5885d82c8c74b4b32c.tar.gz |
- Use exceptions now they work
Diffstat (limited to 'ext/spl/spl_array.c')
-rwxr-xr-x | ext/spl/spl_array.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index c3a037d9dd..b00a3f8534 100755 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -643,8 +643,7 @@ SPL_METHOD(Array, __construct) if (ZEND_NUM_ARGS() == 0) { return; /* nothing to do */ } -/* exceptions do not work yet - php_set_error_handling(EH_THROW, zend_exception_get_default() TSRMLS_CC);*/ + php_set_error_handling(EH_THROW, spl_ce_InvalidArgumentException TSRMLS_CC);*/ intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); @@ -658,8 +657,8 @@ SPL_METHOD(Array, __construct) intern->array = other->array; } else { if (!HASH_OF(*array)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed variable is not an array or object, using empty array instead"); php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); + zend_throw_exception(spl_ce_InvalidArgumentException, "Passed variable is not an array or object, using empty array instead"); return; } zval_dtor(intern->array); |