class SplStack in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-stdlib/src/SplStack.php \Zend\Stdlib\SplStack
Serializable version of SplStack
Hierarchy
Expanded class hierarchy of SplStack
1 string reference to 'SplStack'
- DoublerSpec::its_double_mirrors_alterates_and_instantiates_provided_class in vendor/
phpspec/ prophecy/ spec/ Prophecy/ Doubler/ DoublerSpec.php
File
- vendor/
zendframework/ zend-stdlib/ src/ SplStack.php, line 17
Namespace
Zend\StdlibView source
class SplStack extends \SplStack implements Serializable {
/**
* Serialize to an array representing the stack
*
* @return array
*/
public function toArray() {
$array = [];
foreach ($this as $item) {
$array[] = $item;
}
return $array;
}
/**
* Serialize
*
* @return string
*/
public function serialize() {
return serialize($this
->toArray());
}
/**
* Unserialize
*
* @param string $data
* @return void
*/
public function unserialize($data) {
foreach (unserialize($data) as $item) {
$this
->unshift($item);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SplStack:: |
public | function |
Serialize Overrides SplStack:: |
1 |
SplStack:: |
public | function |
Serialize to an array representing the stack Overrides SplStack:: |
1 |
SplStack:: |
public | function |
Unserialize Overrides SplStack:: |
1 |