public void printStackTrace(PrintWriter out) {
        synchronized (out) {
            super.printStackTrace(out);
            if (rootCause != null && !JDK_SUPPORTS_NESTED) {
                out.print("Caused by: ");
                rootCause.printStackTrace(out);
            }
        }
    }
Prints the stack trace of this exception to the specified writer.

@param out the <code>PrintWriter</code> to use for output
jphp-runtime/src/php/runtime/common/collections/FunctorException.java