- Let this class extend the built-in exception class, this is required   in PHP5. This, of course, breaks the class hierarchy but there is   unfortunately no workaround.   This requirement is idiotic and forces us to do the following:
- Let this class extend the built-in exception class, this is required
  in PHP5. This, of course, breaks the class hierarchy but there is
  unfortunately no workaround.
  This requirement is idiotic and forces us to do the following:

  . Break inheritance.
    Throwable is *not* an object. Thus, when using Object as a class
    type hint, you won`t be able to pass Throwables (or any other
    exceptions, because they all derive from Throwable). Possible
    solution might be to add an interface to XP which both Object
    and Throwable implement.

  . Duplicate code from Object into Throwable. In detail, these are the
    methods hashCode(), equals(), getClassName(), getClass() and
    __toString() - the latter being a wrapper around the magic PHP
    function that simply calls toString().

  . Live with the fact that exception consume even more memory. This is
    due to the fact that trace is a private member in the built-in
    exception class and that we have our own stack trace in the protected
    _trace - we *want* subclasses to have access to it and we *want*
    to have it consist of StackTraceElements, not of an untyped array of
    mixed (which is the same as debug_backtrace() gives us).

  . Ignore the getTrace() and getTraceAsString() methods inherited from
    the built-in exception. They're public, so we can't prohibit users
    from calling them, but they really should be using getStackTrace()
    to get the stack trace. We can't override them as they are final.

  . Cannot have getMessage() documented in Throwable (or getCode(),
    getFile() or getLine() in other exception classes that may want to
    implement these) as all of them are final. Workaround: Choose
    different names (getFileName(), getLineNumber() as seen in
    xml.XMLFormatException).

  As a reference, see the following discussion on the PHP developer's
  mailing list:
  . http://zend.com/lists/php-dev/200402/msg00393.html
  . http://zend.com/lists/php-dev/200402/msg00405.html
  . http://zend.com/lists/php-dev/200402/msg00451.html
  . http://zend.com/lists/php-dev/200402/msg00459.html


git-svn-id: 526f3b90ad6d9b1dfe840af828070ca3d99521ac@3037 d2cacbed-c0f6-0310-851a-9dad52fc623a

johannes85/core