[String] implement __sleep()/__wakeup() on strings
This commit is contained in:
parent
98694d8677
commit
416e40d943
@ -692,6 +692,11 @@ abstract class AbstractString implements \JsonSerializable
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function __sleep(): array
|
||||
{
|
||||
return ['string'];
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->ignoreCase = false;
|
||||
|
@ -347,6 +347,11 @@ class UnicodeString extends AbstractUnicodeString
|
||||
return $prefix === grapheme_extract($this->string, \strlen($prefix), GRAPHEME_EXTR_MAXBYTES);
|
||||
}
|
||||
|
||||
public function __wakeup()
|
||||
{
|
||||
normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string);
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
if (null === $this->ignoreCase) {
|
||||
|
Reference in New Issue
Block a user