/hphp/test/slow/collection_classes/array_push.php
PHP | 26 lines | 19 code | 7 blank | 0 comment | 2 complexity | 51d178c60605cc331034518b202cafee MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- function main() {
- $elts = varray['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
- $v = Vector {'a', 'b', 'c', 'd'};
- var_dump(array_push(inout $v, 'e'));
- var_dump(array_push(inout $v, 'f', 'g', 'h'));
- var_dump($v == new Vector($elts));
- $s = Set {'a', 'b', 'c', 'd'};
- var_dump(array_push(inout $s, 'e'));
- var_dump(array_push(inout $s, 'f', 'g', 'h'));
- var_dump($s == new Set($elts));
- $m = Map{};
- array_push(inout $m, 'a');
- }
- <<__EntryPoint>>
- function main_array_push() {
- main();
- echo "Done\n";
- }