Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $a = new tArray(["The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"]);
- $b = new tArraySegment($a, 2, 5); //"brown", "fox", "jumps", "over", "the"
- $a[3] = 'LION';
- // expected
- var_dump($a); // "The", "quick", "brown", "LION", "jumps", "over", "the", "lazy", "dog"
- var_dump($b); //"brown", "LION", "jumps", "over", "the"
- object(ILLI\System\Collection\TArraySegment)#3 (5) {
- ["__reference":"ILLI\System\Collection\TArraySegment":private]=>
- &object(ILLI\System\Collection\TArray)#2 (4) {
- ["__itMode":"ILLI\System\Collection\TArray":private]=>
- int(0)
- ["__index":"ILLI\System\Collection\TArray":private]=>
- int(0)
- ["__array":"ILLI\System\ProtoArray":private]=>
- array(9) {
- [0]=>
- string(3) "The"
- [1]=>
- string(5) "quick"
- [2]=>
- string(5) "brown"
- [3]=>
- string(4) "LION"
- [4]=>
- string(5) "jumps"
- [5]=>
- string(4) "over"
- [6]=>
- string(3) "the"
- [7]=>
- string(4) "lazy"
- [8]=>
- string(3) "dog"
- }
- ["__protMode":"ILLI\System\ProtoArray":private]=>
- int(0)
- }
- ["__itMode":"ILLI\System\Collection\TArray":private]=>
- int(0)
- ["__index":"ILLI\System\Collection\TArray":private]=>
- int(0)
- ["__array":"ILLI\System\ProtoArray":private]=>
- array(5) {
- [2]=>
- string(5) "brown"
- [3]=>
- string(3) "fox"
- [4]=>
- string(5) "jumps"
- [5]=>
- string(4) "over"
- [6]=>
- string(3) "the"
- }
- ["__protMode":"ILLI\System\ProtoArray":private]=>
- int(0)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement