« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 7 of about 7 for ghost (0.001 sec.)
The MongoDB\Driver\ServerDescription class | PHP 8.3 12432
The MongoDB\Driver\ServerDescription class (mongodb >=1.13.0) はじめに The MongoDB\Driver\ServerDescription class is a value object that represents a server to which the driver is connected. Instances of this class are returned by MongoDB\D ... "RSSecondary" ; const string TYPE_RS_ARBITER = "RSArbiter" ; const string TYPE_RS_OTHER = "RSOther" ; const string TYPE_RS_GHOST = "RSGhost" ; const string TYPE_LOAD_BALANCER = "LoadBalancer" ; /* メソッド */ final public function getHelloResponse (): ... ir hosts lists are useful for discovering the current replica set configuration. MongoDB\Driver\ServerDescription::TYPE_RS_GHOST Replica set ghost server type, returned by MongoDB\Driver\ServerDescription::getType() . Servers may be identified as such ...
https://man.mtool.work/php/8.3/class.mongodb-driver-serverdescription.html
The MongoDB\Driver\Server class | PHP 8.3 11232
The MongoDB\Driver\Server class (mongodb >=1.0.0) はじめに クラス概要 final class MongoDB\Driver\Server { /* 定数 */ const int TYPE_UNKNOWN = 0 ; const int TYPE_STANDALONE = 1 ; const int TYPE_MONGOS = 2 ; const int TYPE_POSSIBLE_PRIMARY = ... RY = 4 ; const int TYPE_RS_SECONDARY = 5 ; const int TYPE_RS_ARBITER = 6 ; const int TYPE_RS_OTHER = 7 ; const int TYPE_RS_GHOST = 8 ; const int TYPE_LOAD_BALANCER = 9 ; /* メソッド */ final private function __construct () final public function execut ... ed, but their hosts lists are useful for discovering the current replica set configuration. MongoDB\Driver\Server::TYPE_RS_GHOST Replica set ghost server type, returned by MongoDB\Driver\Server::getType() . Servers may be identified as such in at leas ...
https://man.mtool.work/php/8.3/class.mongodb-driver-server.html
ReflectionClass::initializeLazyObject — レイジーオブジェクトを強制的に初期化す... 8560
ReflectionClass::initializeLazyObject (PHP 8 >= 8.4.0) ReflectionClass::initializeLazyObject — レイジーオブジェクトを強制的に初期化する 説明 public function ReflectionClass::initializeLazyObject ( object $object ): object 指定された object ... __construct (public int $prop ) { } } $reflector = new ReflectionClass ( Example ::class); $object = $reflector -> newLazyGhost (function ( $object ) { echo "Initializer called\n" ; $object -> __construct ( 1 ); }); var_dump ( $object ); $reflector - ... > initializeLazyObject ( $object ); var_dump ( $object ); ?> 上の例の出力は以下となります。 lazy ghost object(Example)#3 (0) { ["prop"]=> uninitialized(int) } Initializer called object(Example)#3 (1) { ["prop"]=> int(1) } 参考 ... レイジーオブジェクト ReflectionClass::newLazyGhost() - 新しいレイジーゴーストインスタンスを作成する ReflectionClass::markLazyObjectAsInitialized() - イニシャライザまたはファ ...
https://man.mtool.work/php/8.3/reflectionclass.initializelazyobject.html
新機能 | PHP 8.3 8070
新機能 PHP コア プロパティフック オブジェクトのプロパティは、 get および set 操作に 追加のロジックを関連付けることができるようになりました。 使用方法に応じてそのプロパティは、値を持つ場合もありますし、 仮想的、つまり値を持たない場合もありま ... hp class Example { public function __construct (private int $data ) { } // ... } $initializer = static function ( Example $ghost ): void { // データや依存関係を取得します $data = getData (); // 初期化します $ghost -> __construct ( $data ); }; $reflect ... or = new ReflectionClass ( Example ::class); $object = $reflector -> newLazyGhost ( $initializer ); #[\Deprecated] アトリビュート 新しい Deprecated 属性を使用して、関数、メソッド、 およびクラス定数を非推奨 ... すようになりました。 レイジーオブジェクト機能に関連する複数の新しいメソッドと定数が 追加されました: ReflectionClass::newLazyGhost() ReflectionClass::newLazyProxy() ReflectionClass::resetAsLazyGhost() ReflectionClass::resetAsLazyProxy() ReflectionClass: ...
https://man.mtool.work/php/8.3/migration84.new-features.html
ReflectionClass::markLazyObjectAsInitialized — イニシャライザまたはファクトリを... 8070
ReflectionClass::markLazyObjectAsInitialized (PHP 8 >= 8.4.0) ReflectionClass::markLazyObjectAsInitialized — イニシャライザまたはファクトリを呼び出さずレイジーオブジェクトを初期化済みとしてマークする 説明 public function ReflectionClass::ma ... ic string $prop3 = 'default value' ; } $reflector = new ReflectionClass ( Example ::class); $object = $reflector -> newLazyGhost (function ( $object ) { echo "Initializer called\n" ; $object -> prop1 = 'initialized' ; }); $reflector -> getProperty ( ' ... ect ); $reflector -> markLazyObjectAsInitialized ( $object ); var_dump ( $object ); ?> 上の例の出力は以下となります。 lazy ghost object(Example)#3 (1) { ["prop1"]=> string(11) "prop1 value" ["prop2"]=> uninitialized(string) ["prop3"]=> uninitialized(s ... ic string $prop3 = 'default value' ; } $reflector = new ReflectionClass ( Example ::class); $object = $reflector -> newLazyGhost (function ( $object ) { echo "Initializer called\n" ; $object -> prop1 = 'initialized' ; }); $reflector -> getProperty ( ' ...
https://man.mtool.work/php/8.3/reflectionclass.marklazyobjectasinitialized.html
ReflectionClass::newLazyGhost — 新しいレイジーゴーストインスタンスを作成する | ... 8070
ReflectionClass::newLazyGhost (PHP 8 >= 8.4.0) ReflectionClass::newLazyGhost — 新しいレイジーゴーストインスタンスを作成する 説明 public function ReflectionClass::newLazyGhost ( callable $initializer , int $options = 0 ): object クラスの新し ... $prop ) { echo __METHOD__ , "\n" ; } } $reflector = new ReflectionClass ( Example ::class); $object = $reflector -> newLazyGhost (function ( Example $object ) { $object -> __construct ( 1 ); }); var_dump ( $object ); var_dump ( $object instanceof Exam ... ; // 初期化をトリガーし、その後プロパティを取得します var_dump ( $object -> prop ); ?> 上の例の出力は以下となります。 lazy ghost object(Example)#3 (0) { ["prop"]=> uninitialized(int) } bool(true) Example::__construct int(1) 参考 レイジーオブジェクト R ... wInstanceWithoutConstructor() - コンストラクタを起動せずに新しいクラスのインスタンスを作成する ReflectionClass::resetAsLazyGhost() - オブジェクトをリセットしてレイジーとしてマークする ReflectionClass::markLazyObjectAsInitialized() - イニシャライザまた ...
https://man.mtool.work/php/8.3/reflectionclass.newlazyghost.html
レイジーオブジェクト | PHP 8.3 7106
レイジーオブジェクト レイジーオブジェクトは、状態が参照または変更されるまで 初期化が遅延されるオブジェクトです。ユースケースの例として、 必要な時だけ初期化される遅延DIコンポーネント、 必要な時だけデータを読み込む遅延 ORM 、 必要な時だけ解析 ... タンスをレイジーにリセットすることが可能です。 レイジーオブジェクトを作成するエントリーポイントは、 ReflectionClass::newLazyGhost() および ReflectionClass::newLazyProxy() メソッドです。 どちらのメソッドも、オブジェクトの初期化が必要な際に呼び出される関 ... p ) { echo __METHOD__ , "\n" ; } } $reflector = new ReflectionClass ( Example ::class); $lazyObject = $reflector -> newLazyGhost (function ( Example $object ) { // ここでオブジェクトを初期化 $object -> __construct ( 1 ); }); var_dump ( $lazyObject ); ... ( $lazyObject )); // ここで初期化がトリガーされる var_dump ( $lazyObject -> prop ); ?> 上の例の出力は以下となります。 lazy ghost object(Example)#3 (0) { ["prop"]=> uninitialized(int) } string(7) "Example" Example::__construct int(1) 例2 レイジープロキ ...
https://man.mtool.work/php/8.3/language.oop5.lazy-objects.html
PREV 1 NEXT