PHP 8.5.0 RC 2 available for testing

Ds\Sequence::first

(PECL ds >= 1.0.0)

Ds\Sequence::first โ€” Returns the first value in the sequence

่ชฌๆ˜Ž

abstract public Ds\Sequence::first(): mixed

Returns the first value in the sequence.

ใƒ‘ใƒฉใƒกใƒผใ‚ฟ

ใ“ใฎ้–ขๆ•ฐใซใฏใƒ‘ใƒฉใƒกใƒผใ‚ฟใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚

ๆˆปใ‚Šๅ€ค

The first value in the sequence.

ใ‚จใƒฉใƒผ / ไพ‹ๅค–

UnderflowException if empty.

ไพ‹

ไพ‹1 Ds\Sequence::first() example

<?php
$sequence
= new \Ds\Vector([1, 2, 3]);
var_dump($sequence->first());
?>

ไธŠใฎไพ‹ใฎๅ‡บๅŠ›ใฏใ€ ใŸใจใˆใฐไปฅไธ‹ใฎใ‚ˆใ†ใซใชใ‚Šใพใ™ใ€‚

int(1)
๏ผ‹add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top