« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 66 for counter (0.002 sec.)
APCUIterator イテレータオブジェクトを作成する 10388
« APCUIterator APCUIterator::current » PHP Manual APCUIterator APCUIterator イテレータオブジェクトを作成する 検索 APCUIterator::__construct (PECL apcu >= 5.0.0) APCUIterator::__construct — APCUIterator イテレータオブジェクトを作成する 説明 ... ACTIVE あるいは APC_LIST_DELETED を渡します。 例 例1 APCUIterator::__construct() の例 <?php foreach (new APCUIterator ( '/^counter\./' ) as $counter ) { echo " $counter [ key ] : $counter [ value ] \n" ; apc_dec ( $counter [ 'key' ], $counter [ 'value' ... 存在するかどうかを調べる apcu_cache_info() - APCu のデータから、キャッシュされた情報を取得する 関連キーワード: APCUIterator counter construct イテレータオブジェクト apcu null int APCu search format chunk size list 場合 キー key value Search current funct ...
https://man.mtool.work/php/8.3/apcuiterator.construct.html
APCUIterator イテレータオブジェクトを作成する 10317
« APCUIterator APCUIterator::current » PHP Manual APCUIterator APCUIterator イテレータオブジェクトを作成する 検索 APCUIterator::__construct (PECL apcu >= 5.0.0) APCUIterator::__construct — APCUIterator イテレータオブジェクトを作成する 説明 ... ACTIVE あるいは APC_LIST_DELETED を渡します。 例 例1 APCUIterator::__construct() の例 <?php foreach (new APCUIterator ( '/^counter\./' ) as $counter ) { echo " $counter [ key ] : $counter [ value ] \n" ; apc_dec ( $counter [ 'key' ], $counter [ 'value' ... 存在するかどうかを調べる apcu_cache_info() - APCu のデータから、キャッシュされた情報を取得する 関連キーワード: APCUIterator counter construct イテレータオブジェクト apcu APCu format chunk size list キー current マッチ 正規 表現 スキップ 希望 書式 定数 組 ...
https://man.mtool.work/php/8.3/apcuiterator.construct.html
オブジェクトの要素の数を数える 10031
« Countable ArrayAccess » PHP Manual Countable オブジェクトの要素の数を数える 検索 Countable::count (PHP 5 >= 5.1.0, PHP 7, PHP 8) Countable::count — オブジェクトの要素の数を数える 説明 public function Countable::count (): int このメソッドは ... にはパラメータはありません。 戻り値 数えたカスタムの結果を整数値として返します。 例 例1 Countable::count() の例 <?php class Counter implements Countable { private $count = 0 ; public function count (): int { return ++ $this -> count ; } } $counter = new ... Counter ; for ( $i = 0 ; $i < 10 ; ++ $i ) { echo "I have been count()ed " . count ( $counter ) . " times\n" ; } ?> 上の例の出力は、 たとえば以下のようになります。 I have been count()ed 1 times I have been count()ed ... been count()ed 8 times I have been count()ed 9 times I have been count()ed 10 times 関連キーワード: count times Countable Counter counter ArrayAccess 実装 カスタム 整数 implements private return ...
https://man.mtool.work/php/8.3/countable.count.html
オブジェクトの要素の数を数える 9960
« Countable ArrayAccess » PHP Manual Countable オブジェクトの要素の数を数える 検索 Countable::count (PHP 5 >= 5.1.0, PHP 7, PHP 8) Countable::count — オブジェクトの要素の数を数える 説明 public function Countable::count (): int このメソッドは ... にはパラメータはありません。 戻り値 数えたカスタムの結果を整数値として返します。 例 例1 Countable::count() の例 <?php class Counter implements Countable { private $count = 0 ; public function count (): int { return ++ $this -> count ; } } $counter = new ... Counter ; for ( $i = 0 ; $i < 10 ; ++ $i ) { echo "I have been count()ed " . count ( $counter ) . " times\n" ; } ?> 上の例の出力は、 たとえば以下のようになります。 I have been count()ed 1 times I have been count()ed ... 9 times I have been count()ed 10 times 関連キーワード: count ed times Countable オブジェクト 要素 パラメータ function int Counter counter Search ArrayAccess メソッド value 実装 場合 戻り値 カスタム 結果 ...
https://man.mtool.work/php/8.3/countable.count.html
数値アイテムの値を減らす 9889
« Memcached::__construct Memcached::decrementByKey » PHP Manual Memcached 数値アイテムの値を減らす 検索 Memcached::decrement (PECL memcached >= 0.1.0) Memcached::decrement — 数値アイテムの値を減らす 説明 public function Memcached::decrement ... ます。 例 例1 Memcached::decrement() の例 <?php $m = new Memcached (); $m -> addServer ( 'localhost' , 11211 ); $m -> set ( 'counter' , 5 ); $n = $m -> decrement ( 'counter' ); var_dump ( $n ); $n = $m -> decrement ( 'counter' , 10 ); var_dump ( $n ); var ... _dump ( $m -> get ( 'counter' )); $m -> set ( 'counter' , 'abc' ); $n = $m -> increment ( 'counter' ); // アイテムの値が数値でないので、これは失敗します ... ementByKey() - 指定したサーバー上にある数値アイテムの値を減らす 関連キーワード: アイテム Memcached 数値 decrement int 場合 counter var dump offset initial value false decrementByKey key expiry 失敗 set increment サーバー ...
https://man.mtool.work/php/8.3/memcached.decrement.html
数値アイテムの値を減らす 9889
« Memcached::__construct Memcached::decrementByKey » PHP Manual Memcached 数値アイテムの値を減らす 検索 Memcached::decrement (PECL memcached >= 0.1.0) Memcached::decrement — 数値アイテムの値を減らす 説明 public function Memcached::decrement ... ます。 例 例1 Memcached::decrement() の例 <?php $m = new Memcached (); $m -> addServer ( 'localhost' , 11211 ); $m -> set ( 'counter' , 5 ); $n = $m -> decrement ( 'counter' ); var_dump ( $n ); $n = $m -> decrement ( 'counter' , 10 ); var_dump ( $n ); var ... _dump ( $m -> get ( 'counter' )); $m -> set ( 'counter' , 'abc' ); $n = $m -> increment ( 'counter' ); // アイテムの値が数値でないので、これは失敗します ... hed::decrementByKey() - 指定したサーバー上にある数値アイテムの値を減らす 関連キーワード: アイテム Memcached 数値 decrement counter dump offset initial decrementByKey expiry increment サーバー construct memcached 操作 キー 有効期限 成功 addServer localho ...
https://man.mtool.work/php/8.3/memcached.decrement.html
変数のスコープ 9817
« 定義済みの変数 可変変数 » PHP Manual 変数 変数のスコープ 検索 変数のスコープ 変数のスコープは、その変数が定義されたコンテキストです。 PHP には関数スコープとグローバルスコープがあります。 関数の外部で定義されたあらゆる変数は、グローバルスコ ... の内部にある static 変数 <?php function exampleFunction ( $input ) { $result = (static function () use ( $input ) { static $counter = 0 ; $counter ++; return "Input: $input , Counter: $counter \n" ; }); return $result (); } // Calls to exampleFunction wi ... onymous function, so the static // variable does not retain its value. echo exampleFunction ( 'A' ); // Outputs: Input: A, Counter: 1 echo exampleFunction ( 'B' ); // Outputs: Input: B, Counter: 1 (オーバーライドされていない場合) 内部でstatic 変数を使っ ... 初期化できるようになったということです。 例11 継承されたメソッドのstatic 変数を使う <?php class Foo { public static function counter () { static $counter = 0 ; $counter ++; return $counter ; } } class Bar extends Foo {} var_dump ( Foo :: counter ()); // i ...
https://man.mtool.work/php/8.3/language.variables.scope.html
変数のスコープ 9817
« 定義済みの変数 可変変数 » PHP Manual 変数 変数のスコープ 検索 変数のスコープ 変数のスコープは、その変数が定義されたコンテキストです。 PHP には関数スコープとグローバルスコープがあります。 関数の外部で定義されたあらゆる変数は、グローバルスコ ... の内部にある static 変数 <?php function exampleFunction ( $input ) { $result = (static function () use ( $input ) { static $counter = 0 ; $counter ++; return "Input: $input , Counter: $counter \n" ; }); return $result (); } // Calls to exampleFunction wi ... onymous function, so the static // variable does not retain its value. echo exampleFunction ( 'A' ); // Outputs: Input: A, Counter: 1 echo exampleFunction ( 'B' ); // Outputs: Input: B, Counter: 1 (オーバーライドされていない場合) 内部でstatic 変数を使っ ... 初期化できるようになったということです。 例11 継承されたメソッドのstatic 変数を使う <?php class Foo { public static function counter () { static $counter = 0 ; $counter ++; return $counter ; } } class Bar extends Foo {} var_dump ( Foo :: counter ()); // i ...
https://man.mtool.work/php/8.3/language.variables.scope.html
数値アイテムの値を増やす 9389
« Memcached::getVersion Memcached::incrementByKey » PHP Manual Memcached 数値アイテムの値を増やす 検索 Memcached::increment (PECL memcached >= 0.1.0) Memcached::increment — 数値アイテムの値を増やす 説明 public function Memcached::increment ... ます。 例 例1 Memcached::increment() の例 <?php $m = new Memcached (); $m -> addServer ( 'localhost' , 11211 ); $m -> set ( 'counter' , 0 ); $m -> increment ( 'counter' ); $n = $m -> increment ( 'counter' , 10 ); var_dump ( $n ); $m -> set ( 'counter' , ' ... abc' ); $n = $m -> increment ( 'counter' ); // アイテムの値が数値でないので、これは失敗します var_dump ( $n ); ?> 上の例の出力は以下となります。 int(11) bool(fals ... ementByKey() - 指定したサーバー上にある数値アイテムの値を増やす 関連キーワード: アイテム Memcached 数値 increment int 場合 counter offset initial value false incrementByKey key expiry 失敗 set var dump サーバー getVersion ...
https://man.mtool.work/php/8.3/memcached.increment.html
数値アイテムの値を増やす 9389
« Memcached::getVersion Memcached::incrementByKey » PHP Manual Memcached 数値アイテムの値を増やす 検索 Memcached::increment (PECL memcached >= 0.1.0) Memcached::increment — 数値アイテムの値を増やす 説明 public function Memcached::increment ... ます。 例 例1 Memcached::increment() の例 <?php $m = new Memcached (); $m -> addServer ( 'localhost' , 11211 ); $m -> set ( 'counter' , 0 ); $m -> increment ( 'counter' ); $n = $m -> increment ( 'counter' , 10 ); var_dump ( $n ); $m -> set ( 'counter' , ' ... abc' ); $n = $m -> increment ( 'counter' ); // アイテムの値が数値でないので、これは失敗します var_dump ( $n ); ?> 上の例の出力は以下となります。 int(11) bool(fals ... hed::incrementByKey() - 指定したサーバー上にある数値アイテムの値を増やす 関連キーワード: アイテム Memcached 数値 increment counter offset initial incrementByKey expiry dump サーバー getVersion memcached キー 有効期限 成功 addServer localhost 参考 decrem ...
https://man.mtool.work/php/8.3/memcached.increment.html
PREV 1 2 3 4 5 6 7 NEXT