Add mapWithKey() and filterWithKey() APIs
commitde2863dcd0075aa5490b98648315c4fefb8dff08
authorDrew Paroski <andrewparoski@fb.com>
Tue, 28 May 2013 01:03:53 +0000 (27 18:03 -0700)
committerSara Golemon <sgolemon@fb.com>
Fri, 6 Sep 2013 02:39:50 +0000 (5 19:39 -0700)
tree3010b5b0ef289b2ae0ceeffdcac81df1a1c15f9f
parentb989a0d21a10b0497470c5389cd1df9cb6f7cf82
Add mapWithKey() and filterWithKey() APIs

This adds mapWithKey() and filterWithKey() APIs to all keyed collections
(Vector, Map, and StableMap). These APIs are similar to map() and filter().
The key difference is that these APIs pass both the key and the value to
the user callback.

Differential Revision: D939972
hphp/runtime/ext/ext_collections.cpp
hphp/runtime/ext/ext_collections.h
hphp/system/idl/collections.idl.json
hphp/system/php/collections/collections.php
hphp/system/php/lang/KeyedIterable.php
hphp/test/slow/collection_classes/map-filter-with-key.php [new file with mode: 0644]
hphp/test/slow/collection_classes/map-filter-with-key.php.expect [new file with mode: 0644]