Fix getOldestStartTime

Summary: There was a tiny possibility that apc entries would be
freed immediately, even though they were still in use by a request, because
getOldestStartTime could return a value 1 greater than it should have done.

Reviewed By: @alexmalyshev, @jasone

Differential Revision: D1679072

Signature: t1:1679072:1415898450:3de211d0b25623b01c3018fe99fb0a9ae6be2fe5
Error when using "shape" as a type

Summary: At least one person tried to do this.

Fixes https://github.com/facebook/hhvm/issues/3170

Reviewed By: @int3

Differential Revision: D1674539

Signature: t1:1674539:1415945723:4dc8265faf91bc34b239b78d9b2e8d113611ce84
Conversion for AT composites

Summary: Kinda ugly, but since there aren't too many composites this
will do.

Reviewed By: @ptarjan

Differential Revision: D1673940

Signature: t1:1673940:1415958643:ea838fbb8c51b9645f90d73b2ac356df69449ee4
Weaken assert in FileUtil::canonicalize

Summary: If a URL has trailing %00's we'd convert those to null but count them
as part of the length.  There's no vulnerability here since the actually string
length would actually be less than we thought.  So the assertion is too strong
as written.

Reviewed By: @ptarjan

Differential Revision: D1485497
Fix PHP primitive default parameter type check

Summary: Allow primitive default values for parameters with primitive type hints

Reviewed By: @paroski

Differential Revision: D1668186
Add magic quotes to NEWS file

Summary: This is a BC break so should really be in NEWS.

Reviewed By: @JoelMarcey

Differential Revision: D1682085

Signature: t1:1682085:1415992796:591c354c4a2330828c74fd91b005b0c19dcfdf50
Explicitly declare PDOStatement::queryString

Summary: nullable string since that's how PHP5's PDOStatement initializes it.

Closes #1856

Reviewed By: @JoelMarcey

Differential Revision: D1680507

Signature: t1:1680507:1415924741:84e7c35a840e03d4f2221727e029822837876aee
Fix optional 'errorcode' parameter is not set up properly

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

Reviewed By: @JoelMarcey

Differential Revision: D1672902

Signature: t1:1672902:1416001499:97856f2a1dc665cfde057ae1eb7c7f1023098706
Change exit(-1) to exit(EXIT_FAILURE) in hphp

Summary: Changing exit(-1) to exit(EXIT_FAILURE) across fbcode

Reviewed By: @markw65

Differential Revision: D1648402
Remove Pos.file.

Summary: Explicit is better than implicit!

Reviewed By: @jwatzman

Differential Revision: D1677963

Signature: t1:1677963:1415907499:8acc4d937267fb9e4caf573ae541b2d22c5d5fe4
Use a non-worker thread for the job reaper

Summary: Reaping timed-out jobs used to use a worker thread, which causes the
treadmill to back up.  This makes the reaper a dedicated thread, so it doesn't
hold up the treadmill.

Reviewed By: @jdelong

Differential Revision: D1660353
Use musttail to enforce tail call.

Summary: From LLVM manual: "The musttail marker means that the call must be tail call optimized in order for the program to be correct". We should use it when we need tail call to happen.

Reviewed By: @jasone

Differential Revision: D1682217

Signature: t1:1682217:1415995606:133db7fff792a61fb7c199febbe4e31eea8d1ea3
Copy-and-clear instead of detaching JSON StringBuffer

Summary: detach transfers ownership of the buffer to a String; but during JSON
decoding we always start with a 127-character buffer, so short strings end up
wasting a bunch of memory.  Copying gives us tightly allocated strings, and
clear just resets the internal length to zero, so we don't have to allocate a
new buffer.

Reviewed By: @markw65

Differential Revision: D1681172

Signature: t1:1681172:1415990188:2851b963a32ef54861557000bd229e3041ef9e05
Simplify how `hh_client` finds the root

Summary: This used to do very different things depending on if you
specified a root to `hh_client` or not, including different error
messages. I think it makes sense for it to climb up the directory
hierarchy same as if you don't specify a root (see github task), and it
also makes the code cleaner.

Fixes https://github.com/facebook/hhvm/issues/3643

Reviewed By: @int3

Differential Revision: D1682933

Signature: t1:1682933:1416006291:3bf378e5a19598d587e35371f909e064067326dd
unparse dynamic new

Summary: We currently parse new as id*exprlist*exprlist so we can represent
dynamic new only as new *Unknown*. This diff parses it as expr * expr list * expr list
and converts it back into an id during naming

Reviewed By: @paroski

Differential Revision: D1674986

Signature: t1:1674986:1416011812:ddac5e57292e9f7f135d5d502818b0d64cd30eb4
introduce a no collections mode

Summary: Most of the transformations of h2tp that result in code that is
very different from the input has to do with collections. This introduces a mode to
disable all collection related transformations
Fixes https://github.com/facebook/hhvm/issues/4225

Reviewed By: @jwatzman

Differential Revision: D1677973

Signature: t1:1677973:1416015234:220f58d20b5cbe854853174906a5923555766c0a
automatically attempt to convert all hack test inputs

Summary: check files
Fixes https://github.com/facebook/hhvm/issues/4218

Reviewed By: @jwatzman

Differential Revision: D1682211

Signature: t1:1682211:1415999283:9b1db0f1d25a170335453f1917500d00332a500c
support for enums

Summary: This converts first class enums. We convert it into a final class with a private constructor
and use a trait to implement all the enum methods.
Fixes https://github.com/facebook/hhvm/issues/4221

Reviewed By: @jwatzman

Differential Revision: D1682688

Signature: t1:1682688:1416003415:c4522a703537d9b3c1603808a08e8a98749d6660
Remove duplicate stack size code

Summary: We already had code forcing the stack size to 8M,
but recently added more code to force it to 8 in normal mode,
and 16 in ASAN mode.

In addition, the old code always ran, even if the main thread wasn't
going to do much real work (eg when running as a server).

Drop the old code in favor of the new.

Reviewed By: @edwinsmith

Differential Revision: D1683119

Signature: t1:1683119:1416055986:e7fecf294752fc6f2f17478f613919f46929eea2
Fix a bug in Index::lookup_constraint

Reviewed By: @paroski

Differential Revision: D1680897