Fix issues with empty, chunked response

Summary: We call sendRaw at the end of a request, which normally causes
headers to be sent (if they haven't already been sent), and does other
"response started" things. If the response is empty, and chunked encoding
has been requested, we skip sending it.

The result is that onSendEnd fails to close the request, and the client
is left dangling until it times out.

Always send, even if the payload is empty.

Reviewed By: afrind

Differential Revision: D1461250
Remove documented overflow inconsistency

Summary: Docs were stale, we've supported the same overflow behavior as PHP5 for
a while now.

Reviewed By: @swtaarrs

Differential Revision: D1465473
Mark SplFileObject_setCsvControl_error001.php as flaky

Summary: what it says on the tin

Reviewed By: @edwinsmith

Differential Revision: D1465647
typechecker: rename function "type" to fun_kind

Summary: when writing a "typechecker" program that "checks" "types",
 naming fields "type" creates the impression that their contents are
 the very "types" that are being checked, which is a "bad" "idea". More
 seriously, whether a function is async/sync/generator is pretty
 central to the typechecking that we do on its contents.

Reviewed By: msullivan, jwatzman

Differential Revision: D1463796
remove trigger_error from sncompress

Summary: These are hilariously causing a 20% perf regression. I'll put them back once I can migrate us.

Reviewed By: @JoelMarcey

Differential Revision: D1462853
Fix codegen bug when Class* doesn't fit in a dword

Summary: We were assuming that Class* fits in 32-bits, but that's not
necessarily the case.  If it doesn't fit, fall back to using a scratch
register.

Reviewed By: @markw65

Differential Revision: D1465175
make DynamicExtensions work in ini

Summary: I need to change all the callsites, but this one has been asked for the most.

Reviewed By: @fredemmott

Differential Revision: D1464698
Hotfix for #3289 `ReflectionParameter#getClass()` on `callable` type hint should not raise exceptions

Summary: See #3289 - `ReflectionParameter#getClass()` on `callable` type hint should not raise exceptions

PR is NOT tested as I didn't have time to build HHVM today, so I'll have to trust travis here.

Closes https://github.com/facebook/hhvm/pull/3290

Reviewed By: @ptarjan

Differential Revision: D1460709

Pulled By: svcscm
run usercode before ending the request

Summary: Currently, the following happens at the end of a request:
onSendEnd -> run postsend functions -> hphp_context_exit

However, hphp_context_exit can call destructors for objects that are
alive at the end of request. This usercode should be allowed to send
output. This causes a circular reference issue because postsend
functions might need to access those objects.

When we don't have a postsend function, preserve Zend compatibility by
delaying the execution of onSendEnd.

Closes https://github.com/facebook/hhvm/pull/3279

Reviewed By: @markw65

Differential Revision: D1465876

Pulled By: svcscm
Move flaky tests to test/zend/bad

Summary: More of what happened in D1465647

Reviewed By: mcl, bertrand

Differential Revision: D1466742
Fix insertion order in eliminateJmp

Summary: Incrementing the iterator was causing the insertions to happen in kind
of random places.  It seems like the correct thing to do is not to increment.
This probably isn't exercised outside of wholecfg.

Reviewed By: @edwinsmith

Differential Revision: D1463010
PDO MySQL's getCode() didn't match errorInfo

Summary: Fixes #3206

Closes https://github.com/facebook/hhvm/pull/3246

Reviewed By: joelm, fredemmott, ptarjan

Differential Revision: D1447243

Pulled By: svcscm
Catch FailedToListenException from hhprof server startup

Summary: This is probably the source of the uncaught FailedToListenException
that's causing sandbox mode to crash---it's the only call to
Server::start() I can see that's not wrapped in a try-catch.

Reviewed By: @jdelong

Differential Revision: D1465343
Remove restriction on concatenating Tany with a string

Summary: Looks like an old holdover from when strict mode let you do
basically nothing with `Tany`. It's weird, let's just kill it.

Reviewed By: @elgenie

Differential Revision: D1465255
Tag the SilverStripe framework tests to 3.1.5

Summary: Closes https://github.com/facebook/hhvm/pull/3282

Reviewed By: @fredemmott

Differential Revision: D1465874

Pulled By: svcscm
Support AsyncGenerator

Summary: When you yield and await in the same function, you are of type
`AsyncGenerator<Tk, Tv, Ts>` where the generics have the same meaning as
in `Generator<Tk, Tv, Ts>` (yielded key, yielded value, sent value).

Reviewed By: @elgenie

Differential Revision: D1457241
bump third-party after recent folly change
Error if we don't detect an hhconfig when running Hack code

Summary: Lots of folks are "running Hack code" but are utterly unaware
of the typechecker -- and so are accidentally running type-incorrect
code. It's easy enough to detect if you cannot possibly be running the
typechecker, if there is no `.hhconfig` file, so raise a fatal error in
that case.

Reviewed By: @elgenie

Differential Revision: D1407258
Merge pull request #3319 from danslo/static-linking-bump

bump third-party after recent folly change
Expand assert in refcount-opts

Summary: It's firing in prod and this will give us much more useful stacktrace
files.

Reviewed By: @alexmalyshev

Differential Revision: D1468086