本文整理汇总了PHP中SplDoublyLinkedList::bottom方法的典型用法代码示例。如果您正苦于以下问题:PHP SplDoublyLinkedList::bottom方法的具体用法?PHP SplDoublyLinkedList::bottom怎么用?PHP SplDoublyLinkedList::bottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SplDoublyLinkedList
的用法示例。
在下文中一共展示了SplDoublyLinkedList::bottom方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOpcode
/**
* {@inheritdoc}
*/
public function getOpcode()
{
if (count($this->_frames) == 0) {
throw new \UnderflowException('No frames have been added to this message');
}
return $this->_frames->bottom()->getOpcode();
}
示例2: isBinary
/**
* @return boolean
*/
public function isBinary()
{
if ($this->_frames->isEmpty()) {
throw new \UnderflowException('Not enough data has been received to determine if message is binary');
}
return Frame::OP_BINARY === $this->_frames->bottom()->getOpcode();
}
示例3:
$list->key();
// count()
// 获得链表的数量
$list->count();
// rewind()
// 将指针返回至初始节点
$list->rewind();
// current()
// 获得当前节点
$list->current();
// top()
// 返回最后一个节点的值
$list->top();
// bottom()
// 返回第一个节点的值
$list->bottom();
// next()
// 指针移到下一个节点
$list->next();
// prev()
// 指针移到上一个节点, 如果原本指针在第一个,那么前一个节点为-1,并且将无法获得当前值
$list->prev();
// valid()
// 判断该链表是否有更多的值,返回bool
$list->valid();
// isEmpty()
// 判断该链表是否为空链表,返回bool
$list->isEmpty();
// offsetExists($index)
// 判断参索引是否存在,返回bool
$list->offsetExists(2);
示例4: count
$dll->shift();
} catch (RuntimeException $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
// data consistency
$a = 2;
$dll->push($a);
echo $dll->pop() . "\n";
$a = 2;
$dll->unshift($a);
echo $dll->shift() . "\n";
// peakable
$dll->push(1);
$dll->push(2);
echo $dll->top() . "\n";
echo $dll->bottom() . "\n";
$dll->pop();
$dll->pop();
// countable
$dll->push(NULL);
$dll->push(NULL);
echo count($dll) . "\n";
echo $dll->count() . "\n";
var_dump($dll->pop());
var_dump($dll->pop());
// clonable
$dll->push(2);
$dll_clone = clone $dll;
$dll_clone->pop();
echo count($dll) . "\n";
?>
示例5: SplDoublyLinkedList
<?php
$list = new SplDoublyLinkedList();
$list->push("top");
$list->bottom(45);
示例6: SplDoublyLinkedList
<?php
$list = new SplDoublyLinkedList();
$list->push("top");
$list->bottom(array());
示例7: SplDoublyLinkedList
<?php
$list = new SplDoublyLinkedList();
$list->push("top");
$list->bottom(3.14159);
示例8: SplDoublyLinkedList
<?php
$list = new SplDoublyLinkedList();
$list->push("top");
$list->bottom(null);
示例9: SplDoublyLinkedList
<?php
$list = new SplDoublyLinkedList();
$list->push('oh');
$list->push('hai');
$list->push('thar');
echo $list->bottom() . "\n";
$list->offsetUnset(0);
echo $list->bottom() . "\n";
示例10: SplDoublyLinkedList
<?php
$dll = new SplDoublyLinkedList();
$dll->push('Never');
$dll->push('gonna');
$dll->push('give');
// at pos 0, shift everything up
$dll->add(0, 'you');
// Should be the end
$dll->add(4, 'up');
// Somewhere in the middle
$dll->add(2, 'let');
try {
// Key 12 is unaccessible
$dll->add(12, 'down');
} catch (OutOfRangeException $e) {
echo $e->getMessage(), PHP_EOL;
}
foreach ($dll as $key => $val) {
echo $key . '=>' . $val, PHP_EOL;
}
echo "count(): " . $dll->count(), PHP_EOL;
echo "top(): " . $dll->top(), PHP_EOL;
echo "bottom(): " . $dll->bottom(), PHP_EOL;
示例11: bottom
/**
* Peeks a `Token` from the beginning of the list.
*
* @return Token The first token.
* @link http://www.php.net/manual/en/spldoublylinkedlist.bottom.php
*/
public function bottom()
{
return $this->tokens->bottom();
}