introduce container (something that matches arrays and collections only)

Summary: A container is something that can be foreached over, has a known size
 (can be passed to ##count##), and is "specially known" to the
 runtime: an array *or* collection.

 Traversable and KeyedTraversable serve a purpose, but they have the
 problem of not correctly describing how the array builtins now work.
 The runtime supports:

   if (is_array($x) || $x instanceof Collection) { ... }
   function container_builtin(???? $x) { ... } // what is ????

 ... which the typechecker doesn't know how to handle. Or one could write:

   if ($x instanceof KeyedTraversable) { ... }
   function container_builtin(KeyedTraversable $x) { ... }

 ... but that would be unsound, because KeyedIterator and KeyedIterable
 are KeyedTraversable, but not containers.

 Having Container and KeyedContainer allows for container built-ins of
 the array_* familly (and PHP-defined helper functions) to be
 appropriately type-hinted and the runtime and the typechecker to
 agree:

   if ($x instanceof Container) { ... }
   function container_builtin(Container $x) {}

Reviewed By: @paroski

Differential Revision: D1310546
teach typechecker about Container/KeyedContainer

Summary: the typechecker counterpart to {D1310546}.

Reviewed By: @jwatzman

Differential Revision: D1310557
typechecker: improve handling of builtins in hh_single_typecheck

Summary: Instead of pretending that they're present in the file being
 tested (but with incorrect line numbers), use a virtual "builtins.hhi"

Reviewed By: @jwatzman

Differential Revision: D1310565
hack: hack/src/{more_tests=>typecheck}

Summary: ## more_tests ## is not an informative directory name. As
 part of this change, rejiggered the ## .gitignore ## files for tests
 to be more direct, and the ## verify ## script to not require
 symlinking.

Reviewed By: @jwatzman

Differential Revision: D1311162
Support far calls to native builtins

Summary: If a builtin is loaded from a DSO with HNI, it may not be
in the low 2GB, so we need to generate an indirect call
to it.  This diff also fixes trampolines so they correctly
can call faraway code, and removes the too-many-trampoline
assert.  (emitCall can recover from running out of tramps).

Fixes #2637

Reviewed By: @markw65

Differential Revision: D1318778
reflection: definalize Reflection{Function|Method}

Summary: ... apparently people want to extend them for like, no reason.

Closes #2635

Reviewed By: @ptarjan

Differential Revision: D1321061
add support for filtering in find

Summary: The find module provides and API that gives bucket of a files at a time.
The reason is to allow the parser to start before the list of files is computed.
This diff adds support for filtering (a filter that is applied *before* the bucket
of file is computed).

Reviewed By: @avikchaudhuri

Differential Revision: D1320801
Json output mode for hh_client status

Summary: Added a new arg, --json for status. Made it output json in that mode.

Reviewed By: @jwatzman

Differential Revision: D1319217
modify FileUtil::canonicalize() to return String

Summary: More string -> String conversions.

Reviewed By: @scannell

Differential Revision: D1311183
link to new wiki pages

Summary: I made dedicated pages for these since we now have a real side-bar

Reviewed By: @fredemmott

Differential Revision: D1317656
Move hphp/tools/import_zend_test.py

Summary: Makes more sense over here.

Reviewed By: @ptarjan

Differential Revision: D1322104
fix xml re-entry

Summary: Before we dive into the XML library, we need to save the JIT state incase we need it later (for example, to raise a warning).

Reviewed By: @alexmalyshev

Differential Revision: D1321974
revert sql3 update because of https://github.com/hhvm/hhvm-third-party/issues/4
allow redirects in SoapClient requests

Summary: PHP hardcodes this number to 20, but it is never set for SoapClient. I
introduced a constant in HttpClient and replaced 20 in UrlFile as well.

https://github.com/php/php-src/blob/PHP-5.6/ext/standard/http_fopen_wrapper.c#L76
Closes #2620

Reviewed By: @ptarjan

Differential Revision: D1314184

Pulled By: @JoelMarcey
Handle UNIX domain sockets correctly in memcache & memcached extensions

Summary: * Memcache::addServer checks for 'unix://' to determine if the host argument
  represents is a UNIX domain socket. HHVM's version checked for a leading '/'.
* Memcached::addServer checks for a leading '/' to determine if the host
  argument is a UNIX domain socket. HHVM's version did not handle UNIX domain
  sockets at all.

This patch adds UNIX domain socket support to Memcached::addServer, and it
corrects the handling of the host argument in Memcache::addServer.

Fixes #1375.
Closes #2450

Reviewed By: @ptarjan

Differential Revision: D1316665

Pulled By: @JoelMarcey
remove register_cleanup_function

Summary: This is semantically identical to register_postsend_function and that one is named better

Reviewed By: @jdelong

Differential Revision: D1320797
Fix for setting multiple cookies with the same name and added max-age support

Summary: Replaced the CaseInsenMap with a std:vector to support multiple cookies with the same name. This fixes facebook/hhvm#2494

Couple notes regarding further changes I'd suggest are on the commit.

Closes #2526
Closes #2494

Reviewed By: @ptarjan

Differential Revision: D1316339

Pulled By: @JoelMarcey
Full GD Support in Linux

Summary: This pull request enables the remainder of GD support for HHVM on Linux, including imagettfbbox and others. This PR resolves Issue [#2576](https://github.com/facebook/hhvm/issues/2576) and replaces PR [#2588](https://github.com/facebook/hhvm/pull/2588).
Closes #2622

Reviewed By: @ptarjan

Differential Revision: D1314173

Pulled By: @JoelMarcey
IntlDateFormatter->format now formats DateTime objects as well as timestamps

Summary: Closes #2613

Closes #2614

Reviewed By: @ptarjan

Differential Revision: D1313399

Pulled By: @JoelMarcey
Make PDOException a subclass of RuntimeException.

Summary: This matches PHP5 behavior

Closes #2584
Closes #2583

Reviewed By: @ptarjan

Differential Revision: D1314289

Pulled By: @JoelMarcey