@@ -258,7 +258,7 @@ static zend_object *zend_error_exception_new(zend_class_entry *class_type) /* {{
258258
259259/* {{{ proto Exception|Error Exception|Error::__clone()
260260 Clone the exception object */
261- ZEND_COLD ZEND_METHOD (exception , __clone )
261+ ZEND_COLD ZEND_METHOD (Exception , __clone )
262262{
263263 /* Should never be executable */
264264 zend_throw_exception (NULL , "Cannot clone object using __clone()" , 0 );
@@ -267,7 +267,7 @@ ZEND_COLD ZEND_METHOD(exception, __clone)
267267
268268/* {{{ proto Exception|Error::__construct(string message, int code [, Throwable previous])
269269 Exception constructor */
270- ZEND_METHOD (exception , __construct )
270+ ZEND_METHOD (Exception , __construct )
271271{
272272 zend_string * message = NULL ;
273273 zend_long code = 0 ;
@@ -305,7 +305,7 @@ ZEND_METHOD(exception, __construct)
305305 zend_unset_property(i_get_exception_base(object), object, ZSTR_VAL(ZSTR_KNOWN(id)), ZSTR_LEN(ZSTR_KNOWN(id))); \
306306 }
307307
308- ZEND_METHOD (exception , __wakeup )
308+ ZEND_METHOD (Exception , __wakeup )
309309{
310310 zval value , * pvalue ;
311311 zval * object = ZEND_THIS ;
@@ -326,7 +326,7 @@ ZEND_METHOD(exception, __wakeup)
326326
327327/* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno [, Throwable previous]]])
328328 ErrorException constructor */
329- ZEND_METHOD (error_exception , __construct )
329+ ZEND_METHOD (ErrorException , __construct )
330330{
331331 zend_string * message = NULL , * filename = NULL ;
332332 zend_long code = 0 , severity = E_ERROR , lineno ;
@@ -377,7 +377,7 @@ ZEND_METHOD(error_exception, __construct)
377377
378378/* {{{ proto string Exception|Error::getFile()
379379 Get the file in which the exception occurred */
380- ZEND_METHOD (exception , getFile )
380+ ZEND_METHOD (Exception , getFile )
381381{
382382 zval * prop , rv ;
383383
@@ -391,7 +391,7 @@ ZEND_METHOD(exception, getFile)
391391
392392/* {{{ proto int Exception|Error::getLine()
393393 Get the line in which the exception occurred */
394- ZEND_METHOD (exception , getLine )
394+ ZEND_METHOD (Exception , getLine )
395395{
396396 zval * prop , rv ;
397397
@@ -405,7 +405,7 @@ ZEND_METHOD(exception, getLine)
405405
406406/* {{{ proto string Exception|Error::getMessage()
407407 Get the exception message */
408- ZEND_METHOD (exception , getMessage )
408+ ZEND_METHOD (Exception , getMessage )
409409{
410410 zval * prop , rv ;
411411
@@ -419,7 +419,7 @@ ZEND_METHOD(exception, getMessage)
419419
420420/* {{{ proto int Exception|Error::getCode()
421421 Get the exception code */
422- ZEND_METHOD (exception , getCode )
422+ ZEND_METHOD (Exception , getCode )
423423{
424424 zval * prop , rv ;
425425
@@ -433,7 +433,7 @@ ZEND_METHOD(exception, getCode)
433433
434434/* {{{ proto array Exception|Error::getTrace()
435435 Get the stack trace for the location in which the exception occurred */
436- ZEND_METHOD (exception , getTrace )
436+ ZEND_METHOD (Exception , getTrace )
437437{
438438 zval * prop , rv ;
439439
@@ -447,7 +447,7 @@ ZEND_METHOD(exception, getTrace)
447447
448448/* {{{ proto int ErrorException::getSeverity()
449449 Get the exception severity */
450- ZEND_METHOD (error_exception , getSeverity )
450+ ZEND_METHOD (ErrorException , getSeverity )
451451{
452452 zval * prop , rv ;
453453
@@ -590,7 +590,7 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /*
590590
591591/* {{{ proto string Exception|Error::getTraceAsString()
592592 Obtain the backtrace for the exception as a string (instead of an array) */
593- ZEND_METHOD (exception , getTraceAsString )
593+ ZEND_METHOD (Exception , getTraceAsString )
594594{
595595 zval * trace , * frame , rv ;
596596 zend_ulong index ;
@@ -629,7 +629,7 @@ ZEND_METHOD(exception, getTraceAsString)
629629
630630/* {{{ proto Throwable Exception|Error::getPrevious()
631631 Return previous Throwable or NULL. */
632- ZEND_METHOD (exception , getPrevious )
632+ ZEND_METHOD (Exception , getPrevious )
633633{
634634 zval rv ;
635635
@@ -640,7 +640,7 @@ ZEND_METHOD(exception, getPrevious)
640640
641641/* {{{ proto string Exception|Error::__toString()
642642 Obtain the string representation of the Exception object */
643- ZEND_METHOD (exception , __toString )
643+ ZEND_METHOD (Exception , __toString )
644644{
645645 zval trace , * exception ;
646646 zend_class_entry * base_ce ;
@@ -733,51 +733,6 @@ ZEND_METHOD(exception, __toString)
733733}
734734/* }}} */
735735
736- /** {{{ Throwable method definition */
737- static const zend_function_entry zend_funcs_throwable [] = {
738- ZEND_ABSTRACT_ME (throwable , getMessage , arginfo_class_Throwable_getMessage )
739- ZEND_ABSTRACT_ME (throwable , getCode , arginfo_class_Throwable_getCode )
740- ZEND_ABSTRACT_ME (throwable , getFile , arginfo_class_Throwable_getFile )
741- ZEND_ABSTRACT_ME (throwable , getLine , arginfo_class_Throwable_getLine )
742- ZEND_ABSTRACT_ME (throwable , getTrace , arginfo_class_Throwable_getTrace )
743- ZEND_ABSTRACT_ME (throwable , getPrevious , arginfo_class_Throwable_getPrevious )
744- ZEND_ABSTRACT_ME (throwable , getTraceAsString , arginfo_class_Throwable_getTraceAsString )
745- ZEND_FE_END
746- };
747- /* }}} */
748-
749- /* {{{ internal structs */
750- /* All functions that may be used in uncaught exception handlers must be final
751- * and must not throw exceptions. Otherwise we would need a facility to handle
752- * such exceptions in that handler.
753- * Also all getXY() methods are final because thy serve as read only access to
754- * their corresponding properties, no more, no less. If after all you need to
755- * override something then it is method __toString().
756- * And never try to change the state of exceptions and never implement anything
757- * that gives the user anything to accomplish this.
758- */
759- static const zend_function_entry default_exception_functions [] = {
760- ZEND_ME (exception , __clone , arginfo_class_Exception___clone , ZEND_ACC_PRIVATE |ZEND_ACC_FINAL )
761- ZEND_ME (exception , __construct , arginfo_class_Exception___construct , ZEND_ACC_PUBLIC )
762- ZEND_ME (exception , __wakeup , arginfo_class_Exception___wakeup , ZEND_ACC_PUBLIC )
763- ZEND_ME (exception , getMessage , arginfo_class_Exception_getMessage , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
764- ZEND_ME (exception , getCode , arginfo_class_Exception_getCode , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
765- ZEND_ME (exception , getFile , arginfo_class_Exception_getFile , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
766- ZEND_ME (exception , getLine , arginfo_class_Exception_getLine , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
767- ZEND_ME (exception , getTrace , arginfo_class_Exception_getTrace , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
768- ZEND_ME (exception , getPrevious , arginfo_class_Exception_getPrevious , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
769- ZEND_ME (exception , getTraceAsString , arginfo_class_Exception_getTraceAsString , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
770- ZEND_ME (exception , __toString , arginfo_class_Exception___toString , 0 )
771- ZEND_FE_END
772- };
773-
774- static const zend_function_entry error_exception_functions [] = {
775- ZEND_ME (error_exception , __construct , arginfo_class_ErrorException___construct , ZEND_ACC_PUBLIC )
776- ZEND_ME (error_exception , getSeverity , arginfo_class_ErrorException_getSeverity , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
777- ZEND_FE_END
778- };
779- /* }}} */
780-
781736void zend_register_default_exception (void ) /* {{{ */
782737{
783738 zend_class_entry ce ;
@@ -788,7 +743,7 @@ void zend_register_default_exception(void) /* {{{ */
788743 memcpy (& default_exception_handlers , & std_object_handlers , sizeof (zend_object_handlers ));
789744 default_exception_handlers .clone_obj = NULL ;
790745
791- INIT_CLASS_ENTRY (ce , "Exception" , default_exception_functions );
746+ INIT_CLASS_ENTRY (ce , "Exception" , class_Exception_methods );
792747 zend_ce_exception = zend_register_internal_class_ex (& ce , NULL );
793748 zend_ce_exception -> create_object = zend_default_exception_new ;
794749 zend_class_implements (zend_ce_exception , 1 , zend_ce_throwable );
@@ -801,12 +756,12 @@ void zend_register_default_exception(void) /* {{{ */
801756 zend_declare_property_null (zend_ce_exception , "trace" , sizeof ("trace" )- 1 , ZEND_ACC_PRIVATE );
802757 zend_declare_property_null (zend_ce_exception , "previous" , sizeof ("previous" )- 1 , ZEND_ACC_PRIVATE );
803758
804- INIT_CLASS_ENTRY (ce , "ErrorException" , error_exception_functions );
759+ INIT_CLASS_ENTRY (ce , "ErrorException" , class_ErrorException_methods );
805760 zend_ce_error_exception = zend_register_internal_class_ex (& ce , zend_ce_exception );
806761 zend_ce_error_exception -> create_object = zend_error_exception_new ;
807762 zend_declare_property_long (zend_ce_error_exception , "severity" , sizeof ("severity" )- 1 , E_ERROR , ZEND_ACC_PROTECTED );
808763
809- INIT_CLASS_ENTRY (ce , "Error" , default_exception_functions );
764+ INIT_CLASS_ENTRY (ce , "Error" , class_Error_methods );
810765 zend_ce_error = zend_register_internal_class_ex (& ce , NULL );
811766 zend_ce_error -> create_object = zend_default_exception_new ;
812767 zend_class_implements (zend_ce_error , 1 , zend_ce_throwable );
@@ -819,31 +774,31 @@ void zend_register_default_exception(void) /* {{{ */
819774 zend_declare_property_null (zend_ce_error , "trace" , sizeof ("trace" )- 1 , ZEND_ACC_PRIVATE );
820775 zend_declare_property_null (zend_ce_error , "previous" , sizeof ("previous" )- 1 , ZEND_ACC_PRIVATE );
821776
822- INIT_CLASS_ENTRY (ce , "CompileError" , NULL );
777+ INIT_CLASS_ENTRY (ce , "CompileError" , class_CompileError_methods );
823778 zend_ce_compile_error = zend_register_internal_class_ex (& ce , zend_ce_error );
824779 zend_ce_compile_error -> create_object = zend_default_exception_new ;
825780
826- INIT_CLASS_ENTRY (ce , "ParseError" , NULL );
781+ INIT_CLASS_ENTRY (ce , "ParseError" , class_ParseError_methods );
827782 zend_ce_parse_error = zend_register_internal_class_ex (& ce , zend_ce_compile_error );
828783 zend_ce_parse_error -> create_object = zend_default_exception_new ;
829784
830- INIT_CLASS_ENTRY (ce , "TypeError" , NULL );
785+ INIT_CLASS_ENTRY (ce , "TypeError" , class_TypeError_methods );
831786 zend_ce_type_error = zend_register_internal_class_ex (& ce , zend_ce_error );
832787 zend_ce_type_error -> create_object = zend_default_exception_new ;
833788
834- INIT_CLASS_ENTRY (ce , "ArgumentCountError" , NULL );
789+ INIT_CLASS_ENTRY (ce , "ArgumentCountError" , class_ArgumentCountError_methods );
835790 zend_ce_argument_count_error = zend_register_internal_class_ex (& ce , zend_ce_type_error );
836791 zend_ce_argument_count_error -> create_object = zend_default_exception_new ;
837792
838- INIT_CLASS_ENTRY (ce , "ValueError" , NULL );
793+ INIT_CLASS_ENTRY (ce , "ValueError" , class_ValueError_methods );
839794 zend_ce_value_error = zend_register_internal_class_ex (& ce , zend_ce_error );
840795 zend_ce_value_error -> create_object = zend_default_exception_new ;
841796
842- INIT_CLASS_ENTRY (ce , "ArithmeticError" , NULL );
797+ INIT_CLASS_ENTRY (ce , "ArithmeticError" , class_ArithmeticError_methods );
843798 zend_ce_arithmetic_error = zend_register_internal_class_ex (& ce , zend_ce_error );
844799 zend_ce_arithmetic_error -> create_object = zend_default_exception_new ;
845800
846- INIT_CLASS_ENTRY (ce , "DivisionByZeroError" , NULL );
801+ INIT_CLASS_ENTRY (ce , "DivisionByZeroError" , class_DivisionByZeroError_methods );
847802 zend_ce_division_by_zero_error = zend_register_internal_class_ex (& ce , zend_ce_arithmetic_error );
848803 zend_ce_division_by_zero_error -> create_object = zend_default_exception_new ;
849804}
0 commit comments