PHP Ds Deque push() 函数
Ds\Deque::push() 函数可以将值添加到deque的末尾。
语法
public void Ds\Deque::push([ mixed $...values ] )
Ds\Deque::push()函数不返回任何值。
示例1
<?php
deque = new \Ds\Deque([10, 20, 30, 40, 50]); echo("The elements in deque: \n"); print_r(deque);
echo("\n Add number 100 in deque: \n");
deque->push(100); echo("\n The elements in deque: \n"); print_r(deque);
?>
示例2
<?php
deque = new \Ds\Deque([10, 20, 30, 40, 50]); echo("The elements in deque: \n"); print_r(deque);
echo("\n Adding elements in deque: \n");
deque->push(...[60, 70, 80, 90]); echo("\n The elements in deque: \n"); print_r(deque);
?>