PHP 8.2? Readonly ??? ??? ?? ???? ? ?? ?? ? ? ??? ??? ??? ? ?? ?? ???? ???? ?? ? ? ????. 2. ?? ???? ???? ?? ArrayObject? ??? ?? ??? ??? ???? ?? ?? ??? ???? TagCollection? ?? ??? ?? ?? ???? ??????. 3. ?? ???? ???? ?? ?? ???, ?? ??, withx () ???? ?? ??? ????? ??, ?? ??? ?? ? ????? ?????? ??? ????? ?????. 4. ?? ???? ?? ??? ?? ?? ??, ?? ? ??? ?? ????? ?? ? ????? ?? ??? ?????. 5. ??? gotchas?? ???? ? ??? ??? ??? Readonly ??? ???? ?? PHP ?? ? ???? ???? ?? ???? ??? ??? ??? ???? ????? ?? ??????? ??? ??? ????? ?? ?? ? ? ????.
PHP 8.2?? ??? ??? ??????? : Readonly Properties . ??? ?? ?? ??? ?? ??? ??? ??? ???? ?? ?????. ??? ??? ???? ?? ?? ???? ?? ?? ???? ?? ??? ? ??? ??? ??? ??? ??? ????.

PHP?? ???? ??? ?? ??? ??? ?? readonly
???? ??? ??? ????.
Readonly ??? ??????
readonly
??? ?? ?? ??? ???? ? ?? ?? ? ? ????. ? ??? ??? ? ????.

??? ??? { ?? ?? __construct ( ?? readonly String $ id, ?? readonly String $ ??? ) {} }
?? ???? $user->email = 'new@example.com';
a? Cannot modify readonly property
.
??? ?? ???? ???? ?????. ????? ?? ??? ?? ? ??? ????.

?? ???? ?????
??? ???? ??? ?? ??? ??? ???? ??? readonly
??? ??????? ??? ???? ????? ????. ?? ??:
??? ??? ??? { ?? ?? __construct ( ?? readonly String $ ??, ?? readonly ?? $ ?? ) {} } $ post = ??? ??? ??? ( 'PHP 8.2', [ 'php', 'Empable']); $ post-> tags [] = 'readonly'; // ?????! ?? ???? ??? ?? ? ? ????.
?? ????? ???? ??? ????? ?? ?????.
? ??? : ArrayObject
? ? ??? ?? ?? ??? ??
??? ??? ??? { /** * @var readonly arrayobject <int, string> */ ?? readonly arrayobject $ ??; ?? ?? __construct ( ?? readonly String $ ??, ?? $ ?? ) { $ this-> tags = new ArrayObject ($ tags); $ this-> tags-> setflags (ArrayObject :: array_as_props); $ this-> tags-> getflags () & ~ arrayobject :: std_prop_list; } }
?? $post->tags
?? ? ???, ?? ??? ???? ?? ??? (? : $post->tags[] = 'hack'
) ??? ?????. ? ?? ? ? ??? ?? ??? ???? ??? ?? ??? ?? ??? ?????.
?? ???? ? ?? ??? ??????.
/** * @implements \ iteratoraggregate <string> */ ??? tagcollection? \ iteratoraggregate? ????? { ?? ?? $ ??; ?? ?? __construct (?? $ ??) { $ this-> tags = array_values (array_unique ($ tags)); } ?? ?? getiterator () : \ ???? ?? { ??? \ arrayiterator ($ this-> tags)? ?????. } ?? ?? Withadded (String $ tag) : self { ??? ??? ????? ([... $ this-> tags, $ tag]); } } ??? ??? ??? { ?? ?? __construct ( ?? readonly String $ ??, ?? readonly tagcollection $ ?? ) {} }
?? ???? ?????. $post->tags
??? ? ???, ???? ????? ? ????? ???????.
??? ??? ?? ?? ??
PHP?? ??? ??? ??? ????? :
- properties ?? ???
readonly
?????? - constructor ???? ?? ?? ??????
- public ?? ?? ?? ??? ??? ?????
- state ??? ???? ?? ??? ????? ?????
- ???? ?? ???? ???? ?? ?? ???? ??????
- cloning ???? ?? ??? ????? ???? ??
__clone()
???? ?? ??????.
?? ??? ??? { ?? ?? __construct ( ?? readonly String $ id, ?? readonly String $ ??, ?? readonly String $ ??? ) {} // setEmail () ?? ? ????? ?????? ??? ?? ?? ?? (String $ ???) : Self { ??? ??? ????? ($ this-> id, $ this-> name, $ email); } // ?? ?? (?? ??) ?? ?? __clone () { ??? \ badmethodcallexception? ????? ( '??? ??? ?? ??? ???????.'); } }
??:
$ user = ??? ??? ( '123', 'alice', 'alice@example.com'); $ updated = $ user-> withemail ( 'alice@new.com'); // ? ???? // $ ???? ???? ?????
??? gotchas
-
readonly
?? ??? ?? ??? ???? ?????. - ??? ???? ??? ??? Readonly ??? ?? ? ? ????.
- Readonly Props? ?? ? ??? ??? ?? ?? ?? ????.
- PHP?? ?? ???? ???? ?? ???? ??? ?? ??? ?? ??? ?????.
??
PHP 8.2?? readonly
???? ??? ??? ???? ?? ????? ?????. readonly
??? ?? ??, ? ?? ? SETX withX()
?? setX()
)? ???? ???? ?? ??? ??? ??? ????.
??? ?? ? ?????? ???? ????. ??? ???? PHP? ?? ?? ? ????.
????? : ? ? ???? ???? ?????? .
? ??? Readonly ???? PHP? ??? ??? ?????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

PHP?? ?? ?? ??? ???? ?? ??? ? ???? ?? ??? ???? ?? ??? ???? ???? ????. 1. ?? ?? ??? ?? ??? URL ? ?? ??? ????. 2. UrlenCode? ???? ?? ??? ???????. 3. ? ???? ????? ?? ?? ??? ? ?? ??? ?????. 4. ???? ???? ?? ? ? ??? ??? ??? ??? ?????. 5. ??? ?? ??? ????? ?? ????? OG ??? ???? ?????. 6. XSS ??? ???? ?? ??? ??? ?????. ? ???? ??? ??? ???? ??? ?? ?? ??? ??? ???? ??? ?? ??? ?????.

AI? ??? ??? ?? ?? ? ?? ???? ????? ?? ??? ??????. 1. Baidu, Tencent API ?? ?? ?? NLP ?????? ?? ??? AI ?? ?? API? ??????. 2. PHP? ? ?? guzzle? ?? API? ???? ?? ??? ??????. 3. ?? ????? ?? ?? ??? ???? ???? ???? ??? ??? ? ????. 4. ?? ?? ? ?? ???? ?? PHP-L ? PHP_CODESNIFFER? ??????. 5. ???? ????? ???? ?? ?? ??? ?????? ??? ??????. AIAPI? ??? ? ???, ?? ??, ?? ? PHP ?? ??? ??? ???. ?? ???? PSR ??? ???, ??? ????? ????, ?? ??? ???, ????? ??? ????, X? ???????.

1. ?? ???? ??? ??? ?????? ?? ?? ??? ??, ??? ?? ???? ??? (? : ?? ???, ? ? ??), ?? ??? ?? ???? ???? ? ?? ?? ??? ??? ?? ??? ????????. 2. ?? ??? ??? ?? ? ??? ???? ?? ?? ?? ???? ?? ? ?? AUDIT ?? ??? ??? ? ????? ????? ??? ???????. 3. ?? ?? ??? ?? ??? ???????. Recaptchav3 ???? ??, ??? ?? ?? ?? ?? ??, IP ? ?? ??? ??? ??? ?? ???? ??? ?? ??? ????? ??? ???? ????? ??? ?????.

??? ?? ??? ??? ?? JavaScript? MediareCorder API? ?? PHP ???? ???? ?????. 2. PHP? ???? ?? ??? ???? STTAPI (? : Google ?? Baidu ?? ??)? ???? ???? ?????. 3. PHP? ???? AI ??? (? : OpenAigpt)? ????. 4. ?? ?? PHP? TTSAPI (? : Baidu ?? Google ?? ??)? ???? ??? ?? ??? ?????. 5. PHP? ?? ??? ??? ??? ??? ?? ?? ??? ?????. ?? ????? PHP? ?? ???? ?? ?? ?? ??? ??? ?????.

PHP? AI ??? ??? ?? ????? ??? API? ?? ?????. ??? ??? ????? ? ??? ???? ?????. API ??? ?? ?? ??? ???? ??? ??? ???? ???? ? ????. 2. ?? ?? ???? guzzle ?? curl? ???? HTTP ??? ???, JSON ??? ??? ? ???, API ? ?? ??, ??? ? ?? ??? ???? ??, ??? ?? ?? ? ? ?? ????, ??? ?? ? ?????? ?????. 3. ???? ???? ?? ???? API ??, ?? ? ??? ?? ??, ??? ?? ??, ?? ?? ? ??? ??? ??? ?????. ?? ??? ??? ??? ? ??? ???? Propt ?? ? ?? ?? ??, ??? ?? ? ?? ????, ?? ?? ?? ???? ? ??? ?? ? ???? ????? ?????.

PHP? ?????? ????? ?? ?? ?? ???? ???? ?? ???? ???? ?? ?? ???? ?????. 2. ?? ??? ???? ???? ?? ??? ?? ? ??? ??? ???? ?? API/Webhook ??? ??? ?? ???? ??? ??? ??? ??? ?????. 3. ?? ????? ?? ??, ??/???? ????, ???? ??, ???? ? ??? ?????? ????? ?? ??? ???? ???? ?? Dingtalk, SMS ?? ??? ???? ??? ?????? ???? ?? ? ??? ??? ????? ?? ??? ???? ???????.

PhpisstillRelevantinmodernenterpriseenvironments.1. Modernphp (7.xand8.x)? ??? ??, ??? ??, jitcompilation ? modernsyntax, mateitsuilableforlarge-scalepplications

PHP? ??? ??? (? : ???? ??, ??? ??) ? ?? ??? ???? AI ??? ?? ?? ??? ?????. 2. CURL ?? GRPC? ???? AI ??? ???? ??? ? ??? ?? ??? ?????. 3. ??? ?? ?? ?? ??, ?? ??? ? ?? ??? ???? ?????. 4. A/B ? ??? ???? ?? ?? ?? ??? ????? ?? ??? ???? ??? ??????. 5. PHP? ???? ??? ?? ? ??? ??? ?????? Googleads? ?? ?? API? ???? ?? ?? ? ???? ??? ???? ???? ????? CTR ? CVR? ???? CPC? ??? AI ?? ?? ???? ?? ??? ??? ?????.
