Flakeylist mediawiki base conversion test

Summary: Becamse flakey with gmp extension. Same issue exists in PHP5 with gmp conversion - for example:

```
<?php
$in = '0x1234567890abhaer';
$gmp = gmp_init($in, 36);
$val = gmp_strval($gmp, 36);
var_dump(str_pad($val, strlen($in), '0', STR_PAD_LEFT));
```

https://bugzilla.wikimedia.org/show_bug.cgi?id=69249

Reviewed By: @JoelMarcey

Differential Revision: D1482806
Get rid of static Hdf instance in RuntimeOption.

Summary: Resubmitting D1458015.
Avoid constructing static Hdf instance in RuntimeOption.
Instead, registered a call back function in RuntimeOption ("HookOption")
which is called in Load().

Reviewed By: @markw65

Differential Revision: D1480544
Clownlist doctrine2 test that also fails on php5

Summary: refs facebook/hhvm#3375

```
Exception: [Doctrine\Common\Proxy\Exception\OutOfBoundsException] Missing value for primary key id on Doctrine\Tests\Models\CMS\CmsUser

With queries:
18. SQL: '"COMMIT"' Params:
17. SQL: 'INSERT INTO cms_users (status, username, name, email_id) VALUES (?, ?, ?, ?)' Params: '', 'ocramius', 'Marco', ''
16. SQL: '"START TRANSACTION"' Params:
15. SQL: 'CREATE TABLE cms_groups (id INTEGER NOT NULL, name VARCHAR(50) NOT NULL, PRIMARY KEY(id))' Params:
14. SQL: 'CREATE TABLE cms_emails (id INTEGER NOT NULL, email VARCHAR(250) NOT NULL, PRIMARY KEY(id))' Params:
13. SQL: 'CREATE UNIQUE INDEX UNIQ_ACAC157BA76ED395 ON cms_addresses (user_id)' Params:
12. SQL: 'CREATE TABLE cms_addresses (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, country VARCHAR(50) NOT NULL, zip VARCHAR(50) NOT NULL, city VARCHAR(50) NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_ACAC157BA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id) NOT DEFERRABLE INITIALLY IMMEDIATE)' Params:
11. SQL: 'CREATE INDEX IDX_D533FD95A76ED395 ON cms_articles (user_id)' Params:
10. SQL: 'CREATE TABLE cms_articles (id INTEGER NOT NULL, user_id INTEGER DEFAULT NULL, topic VARCHAR(255) NOT NULL, text CLOB NOT NULL, version INTEGER DEFAULT 1 NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_D533FD95A76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id) NOT DEFERRABLE INITIALLY IMMEDIATE)' Params:
9. SQL: 'CREATE INDEX IDX_F21F790FA76ED395 ON cms_phonenumbers (user_id)' Params:
8. SQL: 'CREATE TABLE cms_phonenumbers (phonenumber VARCHAR(50) NOT NULL, user_id INTEGER DEFAULT NULL, PRIMARY KEY(phonenumber), CONSTRAINT FK_F21F790FA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id) NOT DEFERRABLE INITIALLY IMMEDIATE)' Params:
7. SQL: 'CREATE INDEX IDX_7EA9409AFE54D947 ON cms_users_groups (group_id)' Params:
6. SQL: 'CREATE INDEX IDX_7EA9409AA76ED395 ON cms_users_groups (user_id)' Params:
5. SQL: 'CREATE TABLE cms_users_groups (user_id INTEGER NOT NULL, group_id INTEGER NOT NULL, PRIMARY KEY(user_id, group_id), CONSTRAINT FK_7EA9409AA76ED395 FOREIGN KEY (user_id) REFERENCES cms_users (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_7EA9409AFE54D947 FOREIGN KEY (group_id) REFERENCES cms_groups (id) NOT DEFERRABLE INITIALLY IMMEDIATE)' Params:
4. SQL: 'CREATE UNIQUE INDEX UNIQ_3AF03EC5A832C1C9 ON cms_users (email_id)' Params:
3. SQL: 'CREATE UNIQUE INDEX UNIQ_3AF03EC5F85E0677 ON cms_users (username)' Params:
2. SQL: 'CREATE TABLE cms_users (id INTEGER NOT NULL, email_id INTEGER DEFAULT NULL, status VARCHAR(50) DEFAULT NULL, username VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_3AF03EC5A832C1C9 FOREIGN KEY (email_id) REFERENCES cms_emails (id) NOT DEFERRABLE INITIALLY IMMEDIATE)' Params:
```

Reviewed By: @JoelMarcey

Differential Revision: D1482260
Added xdebug server setup code

Summary: This diff adds a class "XDebugServer" that represents an xdebug remote
debugging server. The server is attached and detached in `ext_xdebug.cpp`
similar to the `XDebugProfiler`.

This diff also adds support for taking in config settings using the
environment variable `XDEBUG_CONFIG`. This is necessary for supporting
all the server options php5 xdebug does.

I've also changed the request local data to be thread local. Attaching
the server (in the next diff) revealed some bugs in the current
implementation.

Depends on D1471865.

Reviewed By: @ptarjan

Differential Revision: D1472286
Make sure to free memory used for CodeGenFixups

Summary: std::vector::clear() doesn't reduce its capacity.
Use the swap trick instead.

Some of these are maps or sets, so don't really need this treatment,
but we could change representations, so easier to just do all of them.

Reviewed By: @swtaarrs

Differential Revision: D1481874
Fix bug with idx() for the HHVM open source build

Summary: An assertion (func != nullptr) triggers on the HHVM OSS build when idx() is
not defined and an <?hh file tries to call idx().

This diff fixes the issue by updating the bytecode emitter so that it only
emits the Idx instruction if systemlib defines idx().

Reviewed By: @sgolemon

Differential Revision: D1474391
Fix places where kStrMapKind was not a case along with kIntMapKind and kMixedKind

Reviewed By: @paroski

Differential Revision: D1483939
Make the logic for raising checked array warnings clearer

Summary: Make it explcit in places that we are raising warnings because the templated
array kind is either `kIntMapKind` or `kStrMapKind`. The `!= kMixedKind` checks
should be reserved for behavior that both `kIntMapKind` and `kStrMapKind` should
exhibit.

It worked previously because in array-data.cpp we don't ever instantiate the
templated version with the "wrong" kind because of the different DISPATCH_XXX
macros.

Reviewed By: @elgenie

Differential Revision: D1478372
Checked map-like arrays should not warn for array_merge

Summary: Renumber is only called in the following places:

* array-common.cpp | ArrayCommon::Dequeue | Remove key then renumber (dequeue should already warn/downgrade and is only used by APCLocalArray and NVTWrapper)
* empty-array.cpp | EmptyArray::Merge | Calls MixedArray::Copy(elems) then renumber them (array_merge shouldn't warn)
* type-array.cpp | Array::mergeImpl | If rhs is empty, m_px->renumber() (array_merge shouldn't warn)

In all the places, we don't need to raise a warning, and in fact we don't want
to. This was an oversight by yours truly.

If we do want to raise warnings at a later point (since array_merge does not
support Collections) the proper way to do it would be in f_array_merge, but not
in ::Renumber.

Reviewed By: @elgenie

Differential Revision: D1478885
Allow colons in search queries

Summary: To allow for queries like "Class::" which should return the methods associated with that class

Reviewed By: @joelbeales

Differential Revision: D1482602
Functorize Search Services

Summary: This refactors all the search stuff to be generic, separating the AST parsing part from the rest. There's no real logic changes.

It works like this now

searchUtils (shared stuff between trie and fuzzy)
^
trieSearchService  and fuzzySearchService (generic)
^
searchService (generic, talks to fuzzy/trie search service when appropriate)
^
hackSearchService (ast parsing stuff and entry point)

Future steps: get search out of parsing and into it's own package and hook more cleanly.

Reviewed By: @jwatzman

Differential Revision: D1482567
Use hooks to attach search in hack

Summary: This adds parsing hooks to make it so parsing doesn't need to depend on search.

Then, moved search to it's own folder/'package'.

Reviewed By: @jwatzman

Differential Revision: D1484661
typechecker: UNSAFE_Construct

Summary: ... to allow explicit escape of `<<ConsistentConstruct>>`. In
 the absence of a "## // decl ## *this* declaration" syntax, this is
 better than the alternative of making entire class hierarchies
 type-unsound.

Reviewed By: @jwatzman

Differential Revision: D1481454
typechecker: typing new static() [3/3]

Summary: `new static` is now allowed only on where the class hierarchy
 has required consistently compatible constructor signatures due to
 either properties of the class/`__construct` method, or due to the
 use of the `<<ConsistentConstruct>>` attribute.

Reviewed By: @jwatzman

Differential Revision: D1466669
Don't double close `fd' in readFileAsString()

Summary: This seems bad.

Reviewed By: @bertmaher

Differential Revision: D1485614
Don't insert code on critical edges in IRBuilder::insertLocalPhis

Summary: This was indirectly causing the refcount-opts failure we're seeing in
lots of places. When inserting a LdLoc on an incoming edge to create a phi
node, we have to defer the insertion until after splitting critical edges.

Reviewed By: @bertmaher

Differential Revision: D1485470
ArrayObject::append() should delegate to ArrayObject::offsetSet()

Match php5 implementation by delegating rather than direct manipulation of internal state.
Fixes issue #3403.
Add tests for ArrayObject::append

Test that ArrayObject::offsetSet gets called when calling ArrayObject::append.