Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CLASS TArraySegment EXTENDS TArray
- {
- private $__reference = NULL;
- public function __construct(TArray &$array, $start = NULL, $length = NULL)
- {
- $this->__reference =& $array;
- $f = ($start === NULL)
- ? 0
- : $start;
- $l = ($length === NULL)
- ? $array->peek()
- : $array->peek($start + $length - 1);
- $rawdata = $array->toArray();
- $tmp = [];
- foreach($rawdata as $key => $value)
- if($key >= $f && $key <= $l)
- {
- $$key = $this->__reference->offsetGet($key);
- $tmp[$key] =& $this->__reference->offsetGet($key);
- }
- var_dump($tmp);
- parent::__construct($tmp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement