@@ -754,6 +754,20 @@ ZEND_METHOD(exception, __toString)
754754}
755755/* }}} */
756756
757+ /* {{{ proto string Exception|Error::toString()
758+ Obtain the string representation of the Exception object */
759+ ZEND_METHOD (exception , toString )
760+ {
761+ zval rv ;
762+
763+ ZEND_PARSE_PARAMETERS_NONE ();
764+
765+ zend_call_method_with_0_params (Z_OBJ_P (ZEND_THIS ), NULL , NULL , "__tostring" , & rv );
766+
767+ ZVAL_COPY_VALUE (return_value , & rv );
768+ }
769+ /* }}} */
770+
757771/** {{{ Throwable method definition */
758772static const zend_function_entry zend_funcs_throwable [] = {
759773 ZEND_ABSTRACT_ME (throwable , getMessage , arginfo_class_Throwable_getMessage )
@@ -763,6 +777,7 @@ static const zend_function_entry zend_funcs_throwable[] = {
763777 ZEND_ABSTRACT_ME (throwable , getTrace , arginfo_class_Throwable_getTrace )
764778 ZEND_ABSTRACT_ME (throwable , getPrevious , arginfo_class_Throwable_getPrevious )
765779 ZEND_ABSTRACT_ME (throwable , getTraceAsString , arginfo_class_Throwable_getTraceAsString )
780+ ZEND_ABSTRACT_ME (throwable , __toString , arginfo_class_Throwable___toString )
766781 ZEND_FE_END
767782};
768783/* }}} */
@@ -789,6 +804,7 @@ static const zend_function_entry default_exception_functions[] = {
789804 ZEND_ME (exception , getPrevious , arginfo_class_Exception_getPrevious , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
790805 ZEND_ME (exception , getTraceAsString , arginfo_class_Exception_getTraceAsString , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
791806 ZEND_ME (exception , __toString , arginfo_class_Exception___toString , 0 )
807+ ZEND_ME (exception , toString , arginfo_class_Exception_toString , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
792808 ZEND_FE_END
793809};
794810
0 commit comments