Skip to content
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
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ PHP NEWS
. /dev/poll events.mechanism for Solaris/Illumos setting had been retired.
(David Carlier)

- GMP:
. The GMP class is now final and cannot be extended anymore.

- Intl:
. Added SpoofChecker::setAllowedChars to set unicode chars ranges.
(David Carlier)
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ PHP 8.4 UPGRADE NOTES
object. This is no longer possible, and cloning a DOMXPath object now throws
an error.

- GMP:
. The GMP class is now final and cannot be extended anymore.
RFC: https://wiki.php.net/rfc/gmp-final

- Intl:
. resourcebundle_get(), ResourceBundle::get(), and accessing offsets on a
ResourceBundle object now throw:
Expand Down
2 changes: 1 addition & 1 deletion ext/gmp/gmp.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
*/
const GMP_NATIVE_ENDIAN = UNKNOWN;

class GMP
final class GMP
{
public function __construct(int|string $num = 0, int $base = 0) {}

Expand Down
3 changes: 2 additions & 1 deletion ext/gmp/gmp_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions ext/gmp/tests/final.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
Cannot extend GMP class
--EXTENSIONS--
gmp
--FILE--
<?php

class T extends GMP {}

?>
--EXPECTF--
Fatal error: Class T cannot extend final class GMP in %s on line %d