Skip to content
Open
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
11 changes: 11 additions & 0 deletions mbstring/mbstring.php
Original file line number Diff line number Diff line change
Expand Up @@ -1419,26 +1419,37 @@ function mb_str_split(string $string, int $length = 1, ?string $encoding) {}
/**
* @since 8.3
*/
#[Pure]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alies-dev Shouldn't the functions be marked as #[Pure(true)] instead, since AFAIU they can depend on global state if $encoding parameter isn't passed. In this case, mb_internal_encoding() will be used, which can depend on the global state. Could you please double-check?

function mb_str_pad(string $string, int $length, string $pad_string = " ", int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string {}

/**
* @since 8.4
*/
#[Pure]
function mb_ucfirst(string $string, ?string $encoding = null): string {}

/**
* @since 8.4
*/
#[Pure]
function mb_lcfirst(string $string, ?string $encoding = null): string {}

/**
* @since 8.4
*/
#[Pure]
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string {}

/**
* @since 8.4
*/
#[Pure]
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string {}

/**
* @since 8.4
*/
#[Pure]
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string {}

/**
Expand Down