pspell_new_personal

FunctionRemoved in PHP 8.4

Load a new dictionary with personal wordlist.

PHP 5
PHP 7
PHP 8.0
Improved
PHP 8.1
Improved
PHP 8.2-8.3
PHP 8.4
Removed
PHP 8.5
PHP 8.6

pspell_new_personal Function synopsis

pspell_new_personal(
    string $filename,
    string $language,
    string $spelling = "",
    string $jargon = "",
    string $encoding = "",
    int $mode = 0
  ): PSpell\Dictionary|false

Parameters

$filename

Typestring

The file where words added to the personal list will be stored. It should be an absolute filename beginning with '/' because otherwise it will be relative to $HOME, which is "/root" for most systems, and is probably not what you want.

$language

Typestring

The language code which consists of the two letter ISO 639 language code and an optional two letter ISO 3166 country code after a dash or underscore.

$spelling

OptionalTypestringDefault value""

The requested spelling for languages with more than one spelling such as English. Known values are 'american', 'british', and 'canadian'.

$jargon

OptionalTypestringDefault value""

Extra information to distinguish two different words lists that have the same language and spelling parameters.

$encoding

OptionalTypestringDefault value""

The encoding that words are expected to be in. Valid values are utf-8, iso8859-*, koi8-r, viscii, cp1252, machine unsigned 16, machine unsigned 32.

$mode

OptionalTypeintDefault value0

The mode in which spellchecker will work. There are several modes available:

   Mode is a bitmask constructed from different constants listed above.
   However, [`PSPELL_FAST`](/codex/PSPELL_FAST),
   [`PSPELL_NORMAL`](/codex/PSPELL_NORMAL) and
   [`PSPELL_BAD_SPELLERS`](/codex/PSPELL_BAD_SPELLERS) are mutually exclusive, so you
   should select only one of them.

$mode accepts one of the following constant values:

Return value

TypePSpell\Dictionary|false

Returns an PSpell\Dictionary instance on success, or false on failure.

Changes to the pspell_new_personal Function

PHP 8.4

  • Function removed

PHP 8.1

  • Return type changed: int|false to PSpell\Dictionary|false
  pspell_new_personal(
      string $filename,
      string $language,
      string $spelling = "",
      string $jargon = "",
      string $encoding = "",
      int $mode = 0
-   ): int|false
+   ): PSpell\Dictionary|false

PHP 8.0

  • Return type added: int|false
  • Parameter name of parameter #1 changed: $personal to $filename
  • Parameter type added for parameter #1 ($filename): string
  • Parameter type added for parameter #2 ($language): string
  • Parameter type added for parameter #3 ($spelling): string
  • Parameter default value added for position #3 ($spelling): ""
  • Parameter type added for parameter #4 ($jargon): string
  • Parameter default value added for position #4 ($jargon): ""
  • Parameter type added for parameter #5 ($encoding): string
  • Parameter default value added for position #5 ($encoding): ""
  • Parameter type added for parameter #6 ($mode): int
  • Parameter default value added for position #6 ($mode): 0
  pspell_new_personal(
-     $personal,
+     string $filename,
-     $language,
+     string $language,
-     $spelling,
+     string $spelling = "",
-     $jargon,
+     string $jargon = "",
-     $encoding,
+     string $encoding = "",
-     $mode
+     int $mode = 0
-   )
+   ): int|false

pspell_new_personal Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release No
PHP 8.5Supported (Latest) No
PHP 8.4Supported No
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported Yes
PHP 7.3Unsupported Yes
PHP 7.2Unsupported Yes
PHP 7.1Unsupported Yes
PHP 7.0Unsupported Yes
PHP 5.6Unsupported Yes
PHP 5.5Unsupported Yes
PHP 5.4Unsupported Yes
PHP 5.3Unsupported Yes