PHP Ds Deque reversed() 函数
Ds\Deque::reversed() 函数可以返回一个翻转的副本。
语法
public Ds\Deque Ds\Deque::reversed( void )
Ds\Deque::reversed()函数没有任何参数。
Ds\Deque::reversed()函数可以返回deque的反转副本。
示例1
<?php
deque = new \Ds\Deque([10, 20, 30, 40, 50]); echo("The elements in deque: \n"); var_dump(deque);
deque_new =deque->reversed();
echo("\n The elements of reversed deque: \n");
var_dump($deque_new);
?>
示例2
<?php
deque = new \Ds\Deque(["Tutorials", "Point", "India", "Tutorix"]); echo("The elements of deque: \n"); print_r(deque); 6
deque_new =deque->reversed();
echo("\n The elements of reversed deque: \n");
print_r($deque_new);
?>