All exceptions are defined here in the source code;
php-5.5.15/ext/spl/spl_exceptions.h
and can be found here when you install the devel package (for example, yum install php-devel in Fedora);
/usr/include/php/ext/spl/spl_exceptions.h
and contains the following:
extern PHPAPI zend_class_entry *spl_ce_LogicException; extern PHPAPI zend_class_entry *spl_ce_BadFunctionCallException; extern PHPAPI zend_class_entry *spl_ce_BadMethodCallException; extern PHPAPI zend_class_entry *spl_ce_DomainException; extern PHPAPI zend_class_entry *spl_ce_InvalidArgumentException; extern PHPAPI zend_class_entry *spl_ce_LengthException; extern PHPAPI zend_class_entry *spl_ce_OutOfRangeException; extern PHPAPI zend_class_entry *spl_ce_RuntimeException; extern PHPAPI zend_class_entry *spl_ce_OutOfBoundsException; extern PHPAPI zend_class_entry *spl_ce_OverflowException; extern PHPAPI zend_class_entry *spl_ce_RangeException; extern PHPAPI zend_class_entry *spl_ce_UnderflowException; extern PHPAPI zend_class_entry *spl_ce_UnexpectedValueException;
and can, in accordance with the unit test, be selected as;
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC, "array size cannot be less than zero");
Soren
source share