@@ -258,7 +258,7 @@ static zend_object *zend_error_exception_new(zend_class_entry *class_type) /* {{
258
258
259
259
/* {{{ proto Exception|Error Exception|Error::__clone()
260
260
Clone the exception object */
261
- ZEND_COLD ZEND_METHOD (exception , __clone )
261
+ ZEND_COLD ZEND_METHOD (Exception , __clone )
262
262
{
263
263
/* Should never be executable */
264
264
zend_throw_exception (NULL , "Cannot clone object using __clone()" , 0 );
@@ -267,7 +267,7 @@ ZEND_COLD ZEND_METHOD(exception, __clone)
267
267
268
268
/* {{{ proto Exception|Error::__construct(string message, int code [, Throwable previous])
269
269
Exception constructor */
270
- ZEND_METHOD (exception , __construct )
270
+ ZEND_METHOD (Exception , __construct )
271
271
{
272
272
zend_string * message = NULL ;
273
273
zend_long code = 0 ;
@@ -316,7 +316,7 @@ ZEND_METHOD(exception, __construct)
316
316
zend_unset_property(i_get_exception_base(object), object, ZSTR_VAL(ZSTR_KNOWN(id)), ZSTR_LEN(ZSTR_KNOWN(id))); \
317
317
}
318
318
319
- ZEND_METHOD (exception , __wakeup )
319
+ ZEND_METHOD (Exception , __wakeup )
320
320
{
321
321
zval value , * pvalue ;
322
322
zval * object = ZEND_THIS ;
@@ -337,7 +337,7 @@ ZEND_METHOD(exception, __wakeup)
337
337
338
338
/* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno [, Throwable previous]]])
339
339
ErrorException constructor */
340
- ZEND_METHOD (error_exception , __construct )
340
+ ZEND_METHOD (ErrorException , __construct )
341
341
{
342
342
zend_string * message = NULL , * filename = NULL ;
343
343
zend_long code = 0 , severity = E_ERROR , lineno ;
@@ -398,7 +398,7 @@ ZEND_METHOD(error_exception, __construct)
398
398
399
399
/* {{{ proto string Exception|Error::getFile()
400
400
Get the file in which the exception occurred */
401
- ZEND_METHOD (exception , getFile )
401
+ ZEND_METHOD (Exception , getFile )
402
402
{
403
403
zval * prop , rv ;
404
404
@@ -412,7 +412,7 @@ ZEND_METHOD(exception, getFile)
412
412
413
413
/* {{{ proto int Exception|Error::getLine()
414
414
Get the line in which the exception occurred */
415
- ZEND_METHOD (exception , getLine )
415
+ ZEND_METHOD (Exception , getLine )
416
416
{
417
417
zval * prop , rv ;
418
418
@@ -426,7 +426,7 @@ ZEND_METHOD(exception, getLine)
426
426
427
427
/* {{{ proto string Exception|Error::getMessage()
428
428
Get the exception message */
429
- ZEND_METHOD (exception , getMessage )
429
+ ZEND_METHOD (Exception , getMessage )
430
430
{
431
431
zval * prop , rv ;
432
432
@@ -440,7 +440,7 @@ ZEND_METHOD(exception, getMessage)
440
440
441
441
/* {{{ proto int Exception|Error::getCode()
442
442
Get the exception code */
443
- ZEND_METHOD (exception , getCode )
443
+ ZEND_METHOD (Exception , getCode )
444
444
{
445
445
zval * prop , rv ;
446
446
@@ -454,7 +454,7 @@ ZEND_METHOD(exception, getCode)
454
454
455
455
/* {{{ proto array Exception|Error::getTrace()
456
456
Get the stack trace for the location in which the exception occurred */
457
- ZEND_METHOD (exception , getTrace )
457
+ ZEND_METHOD (Exception , getTrace )
458
458
{
459
459
zval * prop , rv ;
460
460
@@ -468,7 +468,7 @@ ZEND_METHOD(exception, getTrace)
468
468
469
469
/* {{{ proto int ErrorException::getSeverity()
470
470
Get the exception severity */
471
- ZEND_METHOD (error_exception , getSeverity )
471
+ ZEND_METHOD (ErrorException , getSeverity )
472
472
{
473
473
zval * prop , rv ;
474
474
@@ -611,7 +611,7 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /*
611
611
612
612
/* {{{ proto string Exception|Error::getTraceAsString()
613
613
Obtain the backtrace for the exception as a string (instead of an array) */
614
- ZEND_METHOD (exception , getTraceAsString )
614
+ ZEND_METHOD (Exception , getTraceAsString )
615
615
{
616
616
zval * trace , * frame , rv ;
617
617
zend_ulong index ;
@@ -650,7 +650,7 @@ ZEND_METHOD(exception, getTraceAsString)
650
650
651
651
/* {{{ proto Throwable Exception|Error::getPrevious()
652
652
Return previous Throwable or NULL. */
653
- ZEND_METHOD (exception , getPrevious )
653
+ ZEND_METHOD (Exception , getPrevious )
654
654
{
655
655
zval rv ;
656
656
@@ -661,7 +661,7 @@ ZEND_METHOD(exception, getPrevious)
661
661
662
662
/* {{{ proto string Exception|Error::__toString()
663
663
Obtain the string representation of the Exception object */
664
- ZEND_METHOD (exception , __toString )
664
+ ZEND_METHOD (Exception , __toString )
665
665
{
666
666
zval trace , * exception ;
667
667
zend_class_entry * base_ce ;
@@ -754,51 +754,6 @@ ZEND_METHOD(exception, __toString)
754
754
}
755
755
/* }}} */
756
756
757
- /** {{{ Throwable method definition */
758
- static const zend_function_entry zend_funcs_throwable [] = {
759
- ZEND_ABSTRACT_ME (throwable , getMessage , arginfo_class_Throwable_getMessage )
760
- ZEND_ABSTRACT_ME (throwable , getCode , arginfo_class_Throwable_getCode )
761
- ZEND_ABSTRACT_ME (throwable , getFile , arginfo_class_Throwable_getFile )
762
- ZEND_ABSTRACT_ME (throwable , getLine , arginfo_class_Throwable_getLine )
763
- ZEND_ABSTRACT_ME (throwable , getTrace , arginfo_class_Throwable_getTrace )
764
- ZEND_ABSTRACT_ME (throwable , getPrevious , arginfo_class_Throwable_getPrevious )
765
- ZEND_ABSTRACT_ME (throwable , getTraceAsString , arginfo_class_Throwable_getTraceAsString )
766
- ZEND_FE_END
767
- };
768
- /* }}} */
769
-
770
- /* {{{ internal structs */
771
- /* All functions that may be used in uncaught exception handlers must be final
772
- * and must not throw exceptions. Otherwise we would need a facility to handle
773
- * such exceptions in that handler.
774
- * Also all getXY() methods are final because thy serve as read only access to
775
- * their corresponding properties, no more, no less. If after all you need to
776
- * override something then it is method __toString().
777
- * And never try to change the state of exceptions and never implement anything
778
- * that gives the user anything to accomplish this.
779
- */
780
- static const zend_function_entry default_exception_functions [] = {
781
- ZEND_ME (exception , __clone , arginfo_class_Exception___clone , ZEND_ACC_PRIVATE |ZEND_ACC_FINAL )
782
- ZEND_ME (exception , __construct , arginfo_class_Exception___construct , ZEND_ACC_PUBLIC )
783
- ZEND_ME (exception , __wakeup , arginfo_class_Exception___wakeup , ZEND_ACC_PUBLIC )
784
- ZEND_ME (exception , getMessage , arginfo_class_Exception_getMessage , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
785
- ZEND_ME (exception , getCode , arginfo_class_Exception_getCode , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
786
- ZEND_ME (exception , getFile , arginfo_class_Exception_getFile , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
787
- ZEND_ME (exception , getLine , arginfo_class_Exception_getLine , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
788
- ZEND_ME (exception , getTrace , arginfo_class_Exception_getTrace , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
789
- ZEND_ME (exception , getPrevious , arginfo_class_Exception_getPrevious , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
790
- ZEND_ME (exception , getTraceAsString , arginfo_class_Exception_getTraceAsString , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
791
- ZEND_ME (exception , __toString , arginfo_class_Exception___toString , 0 )
792
- ZEND_FE_END
793
- };
794
-
795
- static const zend_function_entry error_exception_functions [] = {
796
- ZEND_ME (error_exception , __construct , arginfo_class_ErrorException___construct , ZEND_ACC_PUBLIC )
797
- ZEND_ME (error_exception , getSeverity , arginfo_class_ErrorException_getSeverity , ZEND_ACC_PUBLIC |ZEND_ACC_FINAL )
798
- ZEND_FE_END
799
- };
800
- /* }}} */
801
-
802
757
void zend_register_default_exception (void ) /* {{{ */
803
758
{
804
759
zend_class_entry ce ;
@@ -809,7 +764,7 @@ void zend_register_default_exception(void) /* {{{ */
809
764
memcpy (& default_exception_handlers , & std_object_handlers , sizeof (zend_object_handlers ));
810
765
default_exception_handlers .clone_obj = NULL ;
811
766
812
- INIT_CLASS_ENTRY (ce , "Exception" , default_exception_functions );
767
+ INIT_CLASS_ENTRY (ce , "Exception" , class_Exception_methods );
813
768
zend_ce_exception = zend_register_internal_class_ex (& ce , NULL );
814
769
zend_ce_exception -> create_object = zend_default_exception_new ;
815
770
zend_class_implements (zend_ce_exception , 1 , zend_ce_throwable );
@@ -822,12 +777,12 @@ void zend_register_default_exception(void) /* {{{ */
822
777
zend_declare_property_null (zend_ce_exception , "trace" , sizeof ("trace" )- 1 , ZEND_ACC_PRIVATE );
823
778
zend_declare_property_null (zend_ce_exception , "previous" , sizeof ("previous" )- 1 , ZEND_ACC_PRIVATE );
824
779
825
- INIT_CLASS_ENTRY (ce , "ErrorException" , error_exception_functions );
780
+ INIT_CLASS_ENTRY (ce , "ErrorException" , class_ErrorException_methods );
826
781
zend_ce_error_exception = zend_register_internal_class_ex (& ce , zend_ce_exception );
827
782
zend_ce_error_exception -> create_object = zend_error_exception_new ;
828
783
zend_declare_property_long (zend_ce_error_exception , "severity" , sizeof ("severity" )- 1 , E_ERROR , ZEND_ACC_PROTECTED );
829
784
830
- INIT_CLASS_ENTRY (ce , "Error" , default_exception_functions );
785
+ INIT_CLASS_ENTRY (ce , "Error" , class_Error_methods );
831
786
zend_ce_error = zend_register_internal_class_ex (& ce , NULL );
832
787
zend_ce_error -> create_object = zend_default_exception_new ;
833
788
zend_class_implements (zend_ce_error , 1 , zend_ce_throwable );
@@ -840,31 +795,31 @@ void zend_register_default_exception(void) /* {{{ */
840
795
zend_declare_property_null (zend_ce_error , "trace" , sizeof ("trace" )- 1 , ZEND_ACC_PRIVATE );
841
796
zend_declare_property_null (zend_ce_error , "previous" , sizeof ("previous" )- 1 , ZEND_ACC_PRIVATE );
842
797
843
- INIT_CLASS_ENTRY (ce , "CompileError" , NULL );
798
+ INIT_CLASS_ENTRY (ce , "CompileError" , class_CompileError_methods );
844
799
zend_ce_compile_error = zend_register_internal_class_ex (& ce , zend_ce_error );
845
800
zend_ce_compile_error -> create_object = zend_default_exception_new ;
846
801
847
- INIT_CLASS_ENTRY (ce , "ParseError" , NULL );
802
+ INIT_CLASS_ENTRY (ce , "ParseError" , class_ParseError_methods );
848
803
zend_ce_parse_error = zend_register_internal_class_ex (& ce , zend_ce_compile_error );
849
804
zend_ce_parse_error -> create_object = zend_default_exception_new ;
850
805
851
- INIT_CLASS_ENTRY (ce , "TypeError" , NULL );
806
+ INIT_CLASS_ENTRY (ce , "TypeError" , class_TypeError_methods );
852
807
zend_ce_type_error = zend_register_internal_class_ex (& ce , zend_ce_error );
853
808
zend_ce_type_error -> create_object = zend_default_exception_new ;
854
809
855
- INIT_CLASS_ENTRY (ce , "ArgumentCountError" , NULL );
810
+ INIT_CLASS_ENTRY (ce , "ArgumentCountError" , class_ArgumentCountError_methods );
856
811
zend_ce_argument_count_error = zend_register_internal_class_ex (& ce , zend_ce_type_error );
857
812
zend_ce_argument_count_error -> create_object = zend_default_exception_new ;
858
813
859
- INIT_CLASS_ENTRY (ce , "ValueError" , NULL );
814
+ INIT_CLASS_ENTRY (ce , "ValueError" , class_ValueError_methods );
860
815
zend_ce_value_error = zend_register_internal_class_ex (& ce , zend_ce_error );
861
816
zend_ce_value_error -> create_object = zend_default_exception_new ;
862
817
863
- INIT_CLASS_ENTRY (ce , "ArithmeticError" , NULL );
818
+ INIT_CLASS_ENTRY (ce , "ArithmeticError" , class_ArithmeticError_methods );
864
819
zend_ce_arithmetic_error = zend_register_internal_class_ex (& ce , zend_ce_error );
865
820
zend_ce_arithmetic_error -> create_object = zend_default_exception_new ;
866
821
867
- INIT_CLASS_ENTRY (ce , "DivisionByZeroError" , NULL );
822
+ INIT_CLASS_ENTRY (ce , "DivisionByZeroError" , class_DivisionByZeroError_methods );
868
823
zend_ce_division_by_zero_error = zend_register_internal_class_ex (& ce , zend_ce_arithmetic_error );
869
824
zend_ce_division_by_zero_error -> create_object = zend_default_exception_new ;
870
825
}
0 commit comments