« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 72 for Sequence (0.001 sec.)
The Sequence interface | PHP 8.3 10062
The Sequence interface (PECL ds >= 1.0.0) はじめに A Sequence describes the behaviour of values arranged in a single, linear dimension. Some languages refer to this as a "List". It's similar to an array that uses incremental integer keys, w ... rned with keys). A more efficient alternative to SplDoublyLinkedList and SplFixedArray . インターフェイス概要 interface Ds\Sequence extends Ds\Collection , ArrayAccess { /* メソッド */ abstract public function allocate ( int $capacity ): void abstract pu ... bstract public function contains ( mixed ...$values ): bool abstract public function filter ( callable $callback = ? ): Ds\Sequence abstract public function find ( mixed $value ): mixed abstract public function first (): mixed abstract public function ge ... string $glue = ? ): string abstract public function last (): mixed abstract public function map ( callable $callback ): Ds\Sequence abstract public function merge ( mixed $values ): Ds\Sequence abstract public function pop (): mixed abstract public funct ...
https://man.mtool.work/php/8.3/class.ds-sequence.html
Ds\Sequence::slice — Returns a sub-sequence of a given range | PHP 8.3 9221
Ds\Sequence::slice (PECL ds >= 1.0.0) Ds\Sequence::slice — Returns a sub-sequence of a given range 説明 abstract public function Ds\Sequence::slice ( int $index , int $length = ? ): Ds\Sequence Creates a sub-sequence of a given range. パラメ ... ータ index The index at which the sub-sequence starts. If positive, the sequence will start at that index in the sequence. If negative, the sequence will start that far ... from the end. length If a length is given and is positive, the resulting sequence will have up to that many values in it. If the length results in an overflow, only values up to the end of the sequence wi ... ll be included. If a length is given and is negative, the sequence will stop that many values from the end. If a length is not provided, the resulting sequence will contain all values betwe ...
https://man.mtool.work/php/8.3/ds-sequence.slice.html
Ds\Sequence::rotate — Rotates the sequence by a given number of rotations | PHP... 9123
Ds\Sequence::rotate (PECL ds >= 1.0.0) Ds\Sequence::rotate — Rotates the sequence by a given number of rotations 説明 abstract public function Ds\Sequence::rotate ( int $rotations ): void Rotates the sequence by a given number of rotations, ... which is equivalent to successively calling $sequence->push($sequence->shift()) if the number of rotations is positive, or $sequence->unshift($sequence->pop()) if negative. パラ ... メータ rotations The number of times the sequence should be rotated. 戻り値 値を返しません。. The sequence of the current instance will be rotated. 例 例1 Ds\Sequence::rota ... te() example <?php $sequence = new \Ds\Vector ([ "a" , "b" , "c" , "d" ]); $sequence -> rotate ( 1 ); // "a" is shifted, then pushed. print_r ( $sequen ...
https://man.mtool.work/php/8.3/ds-sequence.rotate.html
Data Structures | PHP 8.3 8997
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 ... hether an object is equal to the current instance Ds\Hashable::hash — Returns a scalar value to be used as a hash value Ds\Sequence — The Sequence interface Ds\Sequence::allocate — Allocates enough memory for a required capacity Ds\Sequence::apply — Upda ... tes all values by applying a callback function to each value Ds\Sequence::capacity — Returns the current capacity Ds\Sequence::contains — Determines if the sequence contains given values Ds\Seque ... nce::filter — Creates a new sequence using a callable to determine which values to include Ds\Sequence::find — Attempts to find a value's index Ds\Sequence::fi ...
https://man.mtool.work/php/8.3/book.ds.html
Ds\Sequence::contains — Determines if the sequence contains given values | PHP ... 8871
Ds\Sequence::contains (PECL ds >= 1.0.0) Ds\Sequence::contains — Determines if the sequence contains given values 説明 abstract public function Ds\Sequence::contains ( mixed ...$values ): bool Determines if the sequence contains all values. ... パラメータ values Values to check. 戻り値 false if any of the provided values are not in the sequence, true otherwise. 例 例1 Ds\Sequence::contains() example <?php $sequence = new \Ds\Vector ([ 'a' , 'b' , 'c' , 1 , 2 , 3 ]) ... ; var_dump ( $sequence -> contains ( 'a' )); // true var_dump ( $sequence -> contains ( 'a' , 'b' )); // true var_dump ( $sequence -> contains ( ... 'c' , 'd' )); // false var_dump ( $sequence -> contains (...[ 'c' , 'b' , 'a' ])); // true // Always strict var_dump ( $sequence -> contains ( 1 )); // true var_dump ...
https://man.mtool.work/php/8.3/ds-sequence.contains.html
Ds\Sequence::sum — Returns the sum of all values in the sequence | PHP 8.3 8871
Ds\Sequence::sum (PECL ds >= 1.0.0) Ds\Sequence::sum — Returns the sum of all values in the sequence 説明 abstract public function Ds\Sequence::sum (): int | float Returns the sum of all values in the sequence. 注意 : Arrays and objects are ... to zero when calculating the sum. パラメータ この関数にはパラメータはありません。 戻り値 The sum of all the values in the sequence as either a float or int depending on the values in the sequence. 例 例1 Ds\Sequence::sum() integer example <?php $sequenc ... e = new \Ds\Vector ([ 1 , 2 , 3 ]); var_dump ( $sequence -> sum ()); ?> 上の例の出力は、 たとえば以下のようになります。 int(6) 例2 Ds\Sequence::sum() float example <?php $sequence ... = new \Ds\Vector ([ 1 , 2.5 , 3 ]); var_dump ( $sequence -> sum ()); ?> 上の例の出力は、 たとえば以下のようになります。 float(6.5) 他のマニュアルの関連ページ Python typing DuckDB ...
https://man.mtool.work/php/8.3/ds-sequence.sum.html
Ds\Sequence::map — Returns the result of applying a callback to each value | PH... 8773
Ds\Sequence::map (PECL ds >= 1.0.0) Ds\Sequence::map — Returns the result of applying a callback to each value 説明 abstract public function Ds\Sequence::map ( callable $callback ): Ds\Sequence Returns the result of applying a callback func ... tion to each value in the sequence. パラメータ callback function callback ( mixed $value ): mixed A callable to apply to each value in the sequence. The call ... able should return what the new value will be in the new sequence. 戻り値 The result of applying a callback to each value in the sequence. 注意 : The values of the current instance won't b ... e affected. 例 例1 Ds\Sequence::map() example <?php $sequence = new \Ds\Vector ([ 1 , 2 , 3 ]); print_r ( $sequence -> map (function( $value ) { return $ ...
https://man.mtool.work/php/8.3/ds-sequence.map.html
Ds\Sequence::push — Adds values to the end of the sequence | PHP 8.3 8745
Ds\Sequence::push (PECL ds >= 1.0.0) Ds\Sequence::push — Adds values to the end of the sequence 説明 abstract public function Ds\Sequence::push ( mixed ...$values ): void Adds values to the end of the sequence. パラメータ values The values ... to add. 戻り値 値を返しません。 例 例1 Ds\Sequence::push() example <?php $sequence = new \Ds\Vector (); $sequence -> push ( "a" ); $sequence -> push ( "b" ); $sequence -> pu ... sh ( "c" , "d" ); $sequence -> push (...[ "e" , "f" ]); print_r ( $sequence ); ?> 上の例の出力は、 たとえば以下のようになります。 Ds\Vector Object ( [ ...
https://man.mtool.work/php/8.3/ds-sequence.push.html
Ds\Sequence::unshift — Adds values to the front of the sequence | PHP 8.3 8745
Ds\Sequence::unshift (PECL ds >= 1.0.0) Ds\Sequence::unshift — Adds values to the front of the sequence 説明 abstract public function Ds\Sequence::unshift ( mixed $values = ? ): void Adds values to the front of the sequence, moving all the ... current values forward to make room for the new values. パラメータ values The values to add to the front of the sequence. 注意 : Multiple values will be added in the same order that they are passed. 戻り値 値を返しません。 例 例1 Ds\Sequence:: ... unshift() example <?php $sequence = new \Ds\Vector ([ 1 , 2 , 3 ]); $sequence -> unshift ( "a" ); $sequence -> unshift ( "b" , "c" ); print_r ( $sequence ); ... 0] => b [1] => c [2] => a [3] => 1 [4] => 2 [5] => 3 ) 他のマニュアルの関連ページ Python typing Python tuple DuckDB CREATE SEQUENCE Statement DuckDB Create Synthetic Data ...
https://man.mtool.work/php/8.3/ds-sequence.unshift.html
Ds\Sequence::get — Returns the value at a given index | PHP 8.3 8717
Ds\Sequence::get (PECL ds >= 1.0.0) Ds\Sequence::get — Returns the value at a given index 説明 abstract public function Ds\Sequence::get ( int $index ): mixed Returns the value at a given index. パラメータ index The index to access, startin ... g at 0. 戻り値 The value at the requested index. エラー / 例外 OutOfRangeException if the index is not valid. 例 例1 Ds\Sequence::get() example <?php $sequence = new \Ds\Vector ([ "a" , "b" , "c" ]); var_dump ( $sequence -> get ( 0 )); var_dump ( $seq ... uence -> get ( 1 )); var_dump ( $sequence -> get ( 2 )); ?> 上の例の出力は、 たとえば以下のようになります。 string(1) "a" string(1) "b" string(1) "c" 例2 Ds\Sequenc ... e::get() example using array syntax <?php $sequence = new \Ds\Vector ([ "a" , "b" , "c" ]); var_dump ( $sequence [ 0 ]); var_dump ( $sequence [ 1 ]); var_dump ( $sequence [ 2 ...
https://man.mtool.work/php/8.3/ds-sequence.get.html
PREV 1 2 3 4 5 6 7 8 NEXT