diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2015-07-03 13:41:17 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2015-07-03 17:53:40 -0500 |
commit | 5a99c07eccb09c3c8b9f6fe4b83020163aad6498 (patch) | |
tree | 2405c51d16e14ca24fed2811148220388798b222 /Zend/zend_execute.c | |
parent | 866bd89b1d909795bd5ae72121089aef5e0fb204 (diff) | |
download | php-git-5a99c07eccb09c3c8b9f6fe4b83020163aad6498.tar.gz |
Enable throwing custom exceptions from errors
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r-- | Zend/zend_execute.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 4c60eb5ae1..1e6c21371a 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1201,7 +1201,7 @@ static zend_never_inline void zend_assign_to_object_dim(zval *retval, zval *obje /* Note: property_name in this case is really the array index! */ if (!Z_OBJ_HT_P(object)->write_dimension) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); FREE_OP(free_value); return; } @@ -1681,7 +1681,7 @@ convert_to_array: } if (dim == NULL) { - zend_error(E_EXCEPTION | E_ERROR, "[] operator not supported for strings"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "[] operator not supported for strings"); ZVAL_NULL(result); } else { zend_check_string_offset(dim, type); @@ -1689,7 +1689,7 @@ convert_to_array: } } else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (!Z_OBJ_HT_P(container)->read_dimension) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); retval = &EG(error_zval); } else { retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); @@ -1830,7 +1830,7 @@ try_string_offset: } } else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { if (!Z_OBJ_HT_P(container)->read_dimension) { - zend_error(E_EXCEPTION | E_ERROR, "Cannot use object as array"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot use object as array"); ZVAL_NULL(result); } else { retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); @@ -1922,7 +1922,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c ZVAL_INDIRECT(result, ptr); } } else { - zend_error(E_EXCEPTION | E_ERROR, "Cannot access undefined property for object with overloaded property access"); + zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot access undefined property for object with overloaded property access"); ZVAL_INDIRECT(result, &EG(error_zval)); } } else { |