Skip to content

GH-15976: don't say "type alias" #15996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Zend/tests/gh15976/alias-names.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class_alias( 'stdClass', 'bool' );

?>
--EXPECTF--
Deprecated: Using "_" as a type alias is deprecated since 8.4 in %salias-names.php on line 3
Deprecated: Using "_" as a class alias is deprecated since 8.4 in %salias-names.php on line 3

Fatal error: Cannot use "bool" as a type alias as it is reserved in %salias-names.php on line 4
Fatal error: Cannot use "bool" as a class alias as it is reserved in %salias-names.php on line 4
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class foobar {}
class_alias("foobar", "int");
?>
--EXPECTF--
Fatal error: Cannot use "int" as a type alias as it is reserved in %s on line %d
Fatal error: Cannot use "int" as a class alias as it is reserved in %s on line %d
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class foobar {}
class_alias("foobar", "float");
?>
--EXPECTF--
Fatal error: Cannot use "float" as a type alias as it is reserved in %s on line %d
Fatal error: Cannot use "float" as a class alias as it is reserved in %s on line %d
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class foobar {}
class_alias("foobar", "string");
?>
--EXPECTF--
Fatal error: Cannot use "string" as a type alias as it is reserved in %s on line %d
Fatal error: Cannot use "string" as a class alias as it is reserved in %s on line %d
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class foobar {}
class_alias("foobar", "bool");
?>
--EXPECTF--
Fatal error: Cannot use "bool" as a type alias as it is reserved in %s on line %d
Fatal error: Cannot use "bool" as a class alias as it is reserved in %s on line %d
2 changes: 1 addition & 1 deletion Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -3571,7 +3571,7 @@ ZEND_API zend_result zend_register_class_alias_ex(const char *name, size_t name_
zend_str_tolower_copy(ZSTR_VAL(lcname), name, name_len);
}

zend_assert_valid_class_name(lcname, "a type alias");
zend_assert_valid_class_name(lcname, "a class alias");

lcname = zend_new_interned_string(lcname);

Expand Down
Loading