Normalize ARM's link-register-saving convention

In trying to implement codegen for the Call opcode, I'm running into
problems with the differences between ARM and x64's calling conventions,
specifically with regard to how they save return addresses.

Until now, our ARM code hasn't been treating the link register (the
return address register) like it's supposed to be treated. The register
is technically caller-saved, but normal ARM programs (such as C programs
compiled by gcc) don't save and restore it around callsites. Instead,
non-leaf functions just save it at the very beginning and restore it
just before returning, simply as part of setting up and tearing down the
frame.

What this means for us is that we're now saving it on the stack
immediately on entry to the TC, since, viewed through the traditional
calling-convention lens, the entire TC is a non-leaf function. This
means that we no longer need to save/restore around host calls.

Reviewed By: @edwinsmith

Differential Revision: D1133438
Convert ext/ctype to HNI

Convert ext/ctype to HNI

Closes #1612

Reviewed By: @ptarjan

Differential Revision: D1135975

Pulled By: @scannell
Convert ext/apache to HNI

Convert ext/apache to HNI

Closes #1607

Reviewed By: @ptarjan

Differential Revision: D1135889

Pulled By: @scannell
collections: support array_fill_keys ...

... and eliminate some single-use array util functions (of
 questionable utility)

Reviewed By: @paroski

Differential Revision: D1137568
collections: support min() and max() builtins

Specifically, their one-argument form.

Reviewed By: @paroski

Differential Revision: D1137651
Convert Interval::children to intrusive singly linked list.

std::list is inconvenient for three reasons:
1. when splitting, we have to iterate to find the split position
even though we already have the interval we care about.
2. Loops that visit each split interval must do work for the
parent, then a separate loop for the child.
3. we never need the "prev" pointers

A plain 'next' pointer (aka intrusive singly-linked list) solves
all three problems.

Reviewed By: @bertmaher

Differential Revision: D1135956
pfsockopen returns incorrect connections

Persistent connections currently return a cached connection for (key = "hostname").
Expected behavior is to return a cached connection for (key = "hostname + port").
As a result, persistent connections write and read from the wrong socket if you have multiple connections to the same hostname but different port.

Redis hhvm implementation is affected by this bug (probably other modules too, but not MySQL at least, who uses its own socket cache handler).

Closes #1599

Reviewed By: ps

Differential Revision: D1135971

Pulled By: @scannell
Update NEWS for "Coolio"

Per title.

Reviewed By: @ptarjan

Differential Revision: D1136689
Implement codegen for StLoc, Box, and CheckStk in ARM

There's one test case that's giving me fits in trying to implement Call,
and if we were just codegen'ing these opcodes, the problem would just go
away. So here they are.

StLoc happens to be third most frequent punt. CheckStk forced me to get
the jump-chaining machinery working, and it's surprisingly simple.

Reviewed By: @ottoni

Differential Revision: D1136517
Add assert to check for Array return types in IDL

'Array' ends up being KindOfObject, and leads to mysterious segfaults.

Reviewed By: @ptarjan

Differential Revision: D1136568
Break out stuff to mysql_common so I can reuse it for mysqli

- This mostly just moves stuff around. The idea was to put everything that is f_mysql_ in ext_mysql and move everything else into mysql_common
- It also breaks up the query function into two parts because I need it for mysqli
  - Doing the query
  - And getting the result part

Reviewed By: @ptarjan

Differential Revision: D1106027
Don't use boost::to_upper

perf is showing that it's calling dynamic_cast, a lot.

Reviewed By: @jdelong

Differential Revision: D1136788
collections: support in_array() and array_search() builtins

... and remove utility functions rendered irrelevant

Reviewed By: @paroski

Differential Revision: D1137616
remove runtime options for APC stats

Now that we removed the options from the config files we can remove the options in the code as well

Reviewed By: @jdelong

Differential Revision: D1135707
keep around rawPostData just incase someone reads from php://input

What do you think about this? Usually we keep it around anyways in a global variable (`$HTTP_RAW_POST_DATA`) but that is possible to turn off, so we need a fool-proof place to put it to support `php://input`. Before this diff, the code only gave the last packet of the header in libevent and asserted on fastcgi.

Thoughts? I think it is worth supporting as the php docs says

http://www.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data
... the preferred method for accessing the raw POST data is php://input.

Closes #1557

Reviewed By: afrind

Differential Revision: D1129130
Implement ::class

Done mostly in the parser. There was one weird thing, traits have `self::CLASS` refer to themselves instead of the class that uses them. I had to do runtime support for `parent::CLASS` and `static::CLASS`.

Closes #1096

Reviewed By: @elgenie

Differential Revision: D1129169
Revert "Implement ::class"

Reviewed By: ptarjan

This reverts commit 73975187358058e071bbfca5094bb0fc6e23ef86.
json_decode() parity with PHP 5.4

Added depth as the optional third parameter, there is now no
fixed maximum depth for the JSON parser, default depth is still 512, if
a user specifies a larger depth limit then the various stacks are
resized.

JSON_BIGINT_AS_STRING is now supported alongside the FB collection
options.

Closes #1470
Closes #1496

Reviewed By: @ptarjan

Differential Revision: D1117099

Pulled By: @scannell
Add charset= support to PDO mysql DSN

Adds support for charset= in the PDO mysql DSN.

Closes #1309
Closes #1489

Reviewed By: @ptarjan

Differential Revision: D1137883
Fix cURL tests by implementing server script

Many cURL extension tests require an HTTP server to be running
with a specific PHP file available.

Travis will now run this script using the built-in HHVM web server.

I've add skip files so if the user doesn't have the required environment
variable set it will skip the tests, just like PHP does.

Closes #1487

Reviewed By: @ptarjan

Differential Revision: D1117179

Pulled By: @scannell