Skip to content

Commit a812a74

Browse files
committed
Change zend_exception_get_default() to zend_exception_ce
1 parent f9e9d3a commit a812a74

File tree

15 files changed

+33
-38
lines changed

15 files changed

+33
-38
lines changed

Zend/zend_generators.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ void zend_register_generator_ce(void) /* {{{ */
11241124
zend_generator_handlers.get_constructor = zend_generator_get_constructor;
11251125

11261126
INIT_CLASS_ENTRY(ce, "ClosedGeneratorException", NULL);
1127-
zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_exception_get_default());
1127+
zend_ce_ClosedGeneratorException = zend_register_internal_class_ex(&ce, zend_exception_ce);
11281128
}
11291129
/* }}} */
11301130

ext/com_dotnet/com_extension.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
358358
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
359359

360360
INIT_CLASS_ENTRY(ce, "com_exception", NULL);
361-
php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
361+
php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
362362
php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
363363
/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
364364

ext/dom/php_dom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ PHP_MINIT_FUNCTION(dom)
614614
zend_hash_init(&classes, 0, NULL, NULL, 1);
615615

616616
INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
617-
dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default());
617+
dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_ce);
618618
dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL;
619619
zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC);
620620

ext/intl/intl_error.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,13 @@ void intl_errors_set_code( intl_error* err, UErrorCode err_code )
232232

233233
void intl_register_IntlException_class( void )
234234
{
235-
zend_class_entry ce,
236-
*default_exception_ce;
237-
238-
default_exception_ce = zend_exception_get_default( );
239-
235+
zend_class_entry ce;
236+
240237
/* Create and register 'IntlException' class. */
241238
INIT_CLASS_ENTRY_EX( ce, "IntlException", sizeof( "IntlException" ) - 1, NULL );
242239
IntlException_ce_ptr = zend_register_internal_class_ex( &ce,
243-
default_exception_ce );
244-
IntlException_ce_ptr->create_object = default_exception_ce->create_object;
240+
zend_exception_ce );
241+
IntlException_ce_ptr->create_object = zend_exception_ce->create_object;
245242
}
246243

247244
smart_str intl_parse_error_to_string( UParseError* pe )

ext/mysqli/mysqli.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ PHP_MINIT_FUNCTION(mysqli)
606606
#ifdef HAVE_SPL
607607
mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, spl_ce_RuntimeException);
608608
#else
609-
mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_get_default());
609+
mysqli_exception_class_entry = zend_register_internal_class_ex(&cex, zend_exception_ce);
610610
#endif
611611
mysqli_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
612612
zend_declare_property_long(mysqli_exception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
@@ -1302,7 +1302,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
13021302
* single value is an array. Also we'd have to make that one
13031303
* argument passed by reference.
13041304
*/
1305-
zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
1305+
zend_throw_exception(zend_exception_ce, "Parameter ctor_params must be an array", 0);
13061306
return;
13071307
}
13081308
}
@@ -1314,15 +1314,15 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
13141314
fcc.object = Z_OBJ_P(return_value);
13151315

13161316
if (zend_call_function(&fci, &fcc) == FAILURE) {
1317-
zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
1317+
zend_throw_exception_ex(zend_exception_ce, 0, "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
13181318
} else {
13191319
zval_ptr_dtor(&retval);
13201320
}
13211321
if (fci.params) {
13221322
efree(fci.params);
13231323
}
13241324
} else if (ctor_params) {
1325-
zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
1325+
zend_throw_exception_ex(zend_exception_ce, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ZSTR_VAL(ce->name));
13261326
}
13271327
}
13281328
}

ext/pdo/pdo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root) /* {{{ */
9393
}
9494
}
9595
#endif
96-
return zend_exception_get_default();
96+
return zend_exception_ce;
9797
}
9898
/* }}} */
9999

ext/pgsql/pgsql.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2808,7 +2808,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
28082808
* single value is an array. Also we'd have to make that one
28092809
* argument passed by reference.
28102810
*/
2811-
zend_throw_exception(zend_exception_get_default(), "Parameter ctor_params must be an array", 0);
2811+
zend_throw_exception(zend_exception_ce, "Parameter ctor_params must be an array", 0);
28122812
return;
28132813
}
28142814
}
@@ -2820,15 +2820,15 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
28202820
fcc.object = Z_OBJ_P(return_value);
28212821

28222822
if (zend_call_function(&fci, &fcc) == FAILURE) {
2823-
zend_throw_exception_ex(zend_exception_get_default(), 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
2823+
zend_throw_exception_ex(zend_exception_ce, 0, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name);
28242824
} else {
28252825
zval_ptr_dtor(&retval);
28262826
}
28272827
if (fci.params) {
28282828
efree(fci.params);
28292829
}
28302830
} else if (ctor_params) {
2831-
zend_throw_exception_ex(zend_exception_get_default(), 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
2831+
zend_throw_exception_ex(zend_exception_ce, 0, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name);
28322832
}
28332833
}
28342834
}

ext/phar/phar_object.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ static spl_other_handler phar_spl_foreign_handler = {
11181118
PHP_METHOD(Phar, __construct)
11191119
{
11201120
#if !HAVE_SPL
1121-
zend_throw_exception_ex(zend_exception_get_default(), 0, "Cannot instantiate Phar object without SPL extension");
1121+
zend_throw_exception_ex(zend_exception_ce, 0, "Cannot instantiate Phar object without SPL extension");
11221122
#else
11231123
char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
11241124
size_t fname_len, alias_len = 0;
@@ -5290,14 +5290,12 @@ zend_function_entry phar_exception_methods[] = {
52905290
#define REGISTER_PHAR_CLASS_CONST_LONG(class_name, const_name, value) \
52915291
zend_declare_class_constant_long(class_name, const_name, sizeof(const_name)-1, (zend_long)value);
52925292

5293-
#define phar_exception_get_default() zend_exception_get_default()
5294-
52955293
void phar_object_init(void) /* {{{ */
52965294
{
52975295
zend_class_entry ce;
52985296

52995297
INIT_CLASS_ENTRY(ce, "PharException", phar_exception_methods);
5300-
phar_ce_PharException = zend_register_internal_class_ex(&ce, phar_exception_get_default());
5298+
phar_ce_PharException = zend_register_internal_class_ex(&ce, zend_exception_ce);
53015299

53025300
#if HAVE_SPL
53035301
INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);

ext/reflection/php_reflection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6572,7 +6572,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
65726572
reflection_object_handlers.write_property = _reflection_write_property;
65736573

65746574
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionException", reflection_exception_functions);
6575-
reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_get_default());
6575+
reflection_exception_ptr = zend_register_internal_class_ex(&_reflection_entry, zend_exception_ce);
65766576

65776577
INIT_CLASS_ENTRY(_reflection_entry, "Reflection", reflection_functions);
65786578
reflection_ptr = zend_register_internal_class(&_reflection_entry);

ext/simplexml/simplexml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ SXE_METHOD(__construct)
22852285

22862286
if (!docp) {
22872287
((php_libxml_node_object *)sxe)->document = NULL;
2288-
zend_throw_exception(zend_exception_get_default(), "String could not be parsed as XML", 0);
2288+
zend_throw_exception(zend_exception_ce, "String could not be parsed as XML", 0);
22892289
return;
22902290
}
22912291

0 commit comments

Comments
 (0)