PHP 8.5.0 Beta 3 available for testing

Ds\Sequence::shift

(PECL ds >= 1.0.0)

Ds\Sequence::shift โ€” Removes and returns the first value

่ฏดๆ˜Ž

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

Removes and returns the first value.

ๅ‚ๆ•ฐ

ๆญคๅ‡ฝๆ•ฐๆฒกๆœ‰ๅ‚ๆ•ฐใ€‚

่ฟ”ๅ›žๅ€ผ

The first value, which was removed.

้”™่ฏฏ๏ผๅผ‚ๅธธ

UnderflowException if empty.

็คบไพ‹

็คบไพ‹ #1 Ds\Sequence::shift() example

<?php
$sequence
= new \Ds\Vector(["a", "b", "c"]);

var_dump($sequence->shift());
var_dump($sequence->shift());
var_dump($sequence->shift());
?>

ไปฅไธŠ็คบไพ‹็š„่พ“ๅ‡บ็ฑปไผผไบŽ๏ผš

string(1) "a"
string(1) "b"
string(1) "c"
๏ผ‹ๆทปๅŠ ๅค‡ๆณจ

็”จๆˆท่ดก็Œฎ็š„ๅค‡ๆณจ

ๆญค้กต้ขๅฐšๆ— ็”จๆˆท่ดก็Œฎ็š„ๅค‡ๆณจใ€‚
To Top