« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 38 for deque (0.002 sec.)
The Deque class | PHP 8.3 10975
The Deque class (PECL ds >= 1.0.0) はじめに A Deque (pronounced “deck”) is a sequence of values in a contiguous buffer that grows and shrinks automatically. The name is a common abbreviation of “double-ended queue” and is used internally by ... and unshift() are all O(1). Weaknesses Capacity must be a power of 2. insert() and remove() are O(n). クラス概要 class Ds\Deque implements Ds\Sequence , ArrayAccess { /* 定数 */ const int MIN_CAPACITY = 8 ; /* メソッド */ public function allocate ( i ... ity (): int public function clear (): void public function contains ( mixed ...$values ): bool public function copy (): Ds\Deque public function filter ( callable $callback = ? ): Ds\Deque public function find ( mixed $value ): mixed public function f ... c function join ( string $glue = ? ): string public function last (): mixed public function map ( callable $callback ): Ds\Deque public function merge ( mixed $values ): Ds\Deque public function pop (): mixed public function push ( mixed ...$values ): ...
https://man.mtool.work/php/8.3/class.ds-deque.html
Ds\Deque::slice — Returns a sub-deque of a given range | PHP 8.3 9795
Ds\Deque::slice (PECL ds >= 1.0.0) Ds\Deque::slice — Returns a sub-deque of a given range 説明 public function Ds\Deque::slice ( int $index , int $length = ? ): Ds\Deque Creates a sub-deque of a given range. パラメータ index The index at wh ... ich the sub-deque starts. If positive, the deque will start at that index in the deque. If negative, the deque will start that far from the ... end. length If a length is given and is positive, the resulting deque will have up to that many values in it. If the length results in an overflow, only values up to the end of the deque will ... be included. If a length is given and is negative, the deque will stop that many values from the end. If a length is not provided, the resulting deque will contain all values between ...
https://man.mtool.work/php/8.3/ds-deque.slice.html
Data Structures | PHP 8.3 9104
Data Structures はじめに Efficient data structures for PHP 7, provided as an alternative to the array . See » this blog post for benchmarks, discussion and frequently asked questions. インストール/設定 要件 インストール手順 例 Ds\Collection ... vector Ds\Vector::toArray — Converts the vector to an array Ds\Vector::unshift — Adds values to the front of the vector Ds\Deque — The Deque class Ds\Deque::allocate — Allocates enough memory for a required capacity Ds\Deque::apply — Updates all value ... s by applying a callback function to each value Ds\Deque::capacity — Returns the current capacity Ds\Deque::clear — Removes all values from the deque Ds\Deque::__construct — Creat ... es a new instance Ds\Deque::contains — Determines if the deque contains given values Ds\Deque::copy — Returns a shallow copy of the deque Ds\Deque::c ...
https://man.mtool.work/php/8.3/book.ds.html
Ds\Deque::rotate — Rotates the deque by a given number of rotations | PHP 8.3 9104
Ds\Deque::rotate (PECL ds >= 1.0.0) Ds\Deque::rotate — Rotates the deque by a given number of rotations 説明 public function Ds\Deque::rotate ( int $rotations ): void Rotates the deque by a given number of rotations, which is equivalent to ... successively calling $deque->push($deque->shift()) if the number of rotations is positive, or $deque->unshift($deque->pop()) if negative. パラメータ r ... otations The number of times the deque should be rotated. 戻り値 値を返しません。. The deque of the current instance will be rotated. 例 例1 Ds\Deque::rotate() e ... xample <?php $deque = new \Ds\Deque ([ "a" , "b" , "c" , "d" ]); $deque -> rotate ( 1 ); // "a" is shifted, then pushed. print_r ( $deque ); $ ...
https://man.mtool.work/php/8.3/ds-deque.rotate.html
Ds\Deque::map — Returns the result of applying a callback to each value | PHP 8... 8600
Ds\Deque::map (PECL ds >= 1.0.0) Ds\Deque::map — Returns the result of applying a callback to each value 説明 public function Ds\Deque::map ( callable $callback ): Ds\Deque Returns the result of applying a callback function to each value in ... the deque. パラメータ callback function callback ( mixed $value ): mixed A callable to apply to each value in the deque. The callabl ... e should return what the new value will be in the new deque. 戻り値 The result of applying a callback to each value in the deque. 注意 : The values of the current instance won't be a ... ffected. 例 例1 Ds\Deque::map() example <?php $deque = new \Ds\Deque ([ 1 , 2 , 3 ]); print_r ( $deque -> map (function( $value ) { return $value * ...
https://man.mtool.work/php/8.3/ds-deque.map.html
Ds\Deque::sum — Returns the sum of all values in the deque | PHP 8.3 8600
Ds\Deque::sum (PECL ds >= 1.0.0) Ds\Deque::sum — Returns the sum of all values in the deque 説明 public function Ds\Deque::sum (): int | float Returns the sum of all values in the deque. 注意 : Arrays and objects are considered equal to zer ... o when calculating the sum. パラメータ この関数にはパラメータはありません。 戻り値 The sum of all the values in the deque as either a float or int depending on the values in the deque. 例 例1 Ds\Deque::sum() integer example <?php $deque = new \ ... Ds\Deque ([ 1 , 2 , 3 ]); var_dump ( $deque -> sum ()); ?> 上の例の出力は、 たとえば以下のようになります。 int(6) 例2 Ds\Deque::sum ... () float example <?php $deque = new \Ds\Deque ([ 1 , 2.5 , 3 ]); var_dump ( $deque -> sum ()); ?> 上の例の出力は、 たとえば以下のようになります。 float( ...
https://man.mtool.work/php/8.3/ds-deque.sum.html
Ds\Deque::contains — Determines if the deque contains given values | PHP 8.3 8553
Ds\Deque::contains (PECL ds >= 1.0.0) Ds\Deque::contains — Determines if the deque contains given values 説明 public function Ds\Deque::contains ( mixed ...$values ): bool Determines if the deque contains all values. パラメータ values Value ... s to check. 戻り値 false if any of the provided values are not in the deque, true otherwise. 例 例1 Ds\Deque::contains() example <?php $deque = new \Ds\Deque ([ 'a' , 'b' , 'c' , 1 , 2 , 3 ]); var_d ... ump ( $deque -> contains ( 'a' )); // true var_dump ( $deque -> contains ( 'a' , 'b' )); // true var_dump ( $deque -> contains ( 'c' , ... 'd' )); // false var_dump ( $deque -> contains (...[ 'c' , 'b' , 'a' ])); // true // Always strict var_dump ( $deque -> contains ( 1 )); // true var_dump ( $ ...
https://man.mtool.work/php/8.3/ds-deque.contains.html
Ds\Deque::filter — Creates a new deque using a callable | PHP 8.3 8553
Ds\Deque::filter (PECL ds >= 1.0.0) Ds\Deque::filter — Creates a new deque using a callable to determine which values to include 説明 public function Ds\Deque::filter ( callable $callback = ? ): Ds\Deque Creates a new deque using a callable ... ise. If a callback is not provided, only values which are true (see converting to boolean ) will be included. 戻り値 A new deque containing all the values for which either the callback returned true , or all values that convert to true if a callback w ... as not provided. 例 例1 Ds\Deque::filter() example using callback function <?php $deque = new \Ds\Deque ([ 1 , 2 , 3 , 4 , 5 ]); var_dump ( $deque -> filte ... r (function( $value ) { return $value % 2 == 0 ; })); ?> 上の例の出力は、 たとえば以下のようになります。 object(Ds\Deque)#3 (2) { [0]=> int(2) [1]=> int(4) } 例2 Ds\Deque::filter() example without a callback function <?php $deque = new \Ds\Deq ...
https://man.mtool.work/php/8.3/ds-deque.filter.html
Ds\Deque::clear — Removes all values from the deque | PHP 8.3 8506
Ds\Deque::clear (PECL ds >= 1.0.0) Ds\Deque::clear — Removes all values from the deque 説明 public function Ds\Deque::clear (): void Removes all values from the deque. パラメータ この関数にはパラメータはありません。 戻り値 値を返しません。 ... 例 例1 Ds\Deque::clear() example <?php $deque = new \Ds\Deque ([ 1 , 2 , 3 ]); print_r ( $deque ); $deque -> clear (); print_r ( $deque ); ... ?> 上の例の出力は、 たとえば以下のようになります。 Ds\Deque Object ( [0] => 1 [1] => 2 [2] => 3 ) Ds\Deque Object ( ) 他のマニュアルの関連ページ Python datatypes Linux JM uuid_clear( ...
https://man.mtool.work/php/8.3/ds-deque.clear.html
Ds\Deque::push — Adds values to the end of the deque | PHP 8.3 8506
Ds\Deque::push (PECL ds >= 1.0.0) Ds\Deque::push — Adds values to the end of the deque 説明 public function Ds\Deque::push ( mixed ...$values ): void Adds values to the end of the deque. パラメータ values The values to add. 戻り値 値を返しま ... せん。 例 例1 Ds\Deque::push() example <?php $deque = new \Ds\Deque (); $deque -> push ( "a" ); $deque -> push ( "b" ); $deque -> push ( "c" , "d ... " ); $deque -> push (...[ "e" , "f" ]); print_r ( $deque ); ?> 上の例の出力は、 たとえば以下のようになります。 Ds\Deque Object ( [0] = ...
https://man.mtool.work/php/8.3/ds-deque.push.html
PREV 1 2 3 4 NEXT