Disable flaky zend test

Reviewed By: @bertmaher
Parse tokens are not trivial in HHVM

Summary: CVE-2013-3735

Reviewed By: @LiraNuna

Differential Revision: D1384586
Document the clownlist better

Summary: Looks like I can unclownlist mustache in the near future, but not the others :'(

Reviewed By: @JoelMarcey

Differential Revision: D1394928
Clownlist a bad assetic test, re-record

Summary: Additionally, jpegtran has always been skipped as we don't have that binary available on our systems.

Reviewed By: @JoelMarcey

Differential Revision: D1394898
Unary `!` on unused awaitables is dangerous

Summary: Extend "dangerous awaitable" check to unary not.

Reviewed By: @pikatchu

Differential Revision: D1383362
Initial work to get loops through the JIT

Summary: This diff tweaks the hot-trace region former to expose some loops
(under a runtime option), and does a few necessary changes to get the
IR built and going through the backend.  All optimization passes are
disabled for now, and only register allocation and code generation are
performed.

Reviewed By: @bertmaher

Differential Revision: D1391337
Clownlist guzzle test with example.com dependency

Summary: Pretty much everything with an external dependency is unreliable at our scale.

Reviewed By: @JoelMarcey

Differential Revision: D1395162
Make each OSS PHPUnit process use a different tempdir

Summary: Should reduce the number of parralelism issues. RE Stash re-record: 1 test fixed by this - and memcache tests should always have been skip as our test infra doesn't provide a memcached server.

Reviewed By: @JoelMarcey

Differential Revision: D1394794
Fix PHP_EXTRA_VERSION.

Summary: This is a continuation of #2943.
Closes #2970

Reviewed By: @LiraNuna

Differential Revision: D1393799

Pulled By: @JoelMarcey
set default thread count to cpu * 2

Summary: A heuristic invented by @joelpob. Thoughts?

Reviewed By: @jdelong

Differential Revision: D1392472
Changed errormessage in implode()

Summary: It errors if none of the arguments is a container.
Added the function name to it to be more clear

Resolves #2567
Closes #2974

Reviewed By: @ptarjan

Differential Revision: D1393809

Pulled By: @JoelMarcey
Allow empty keys in hash_hmac() and hash_hmac_file()

Summary: Zend PHP accepts the empty string as a key for hash_hmac() and
hash_hmac_file(), but HHVM doesn't, because its implementation of these
functions delegates to hash_init(), which does not accept an empty key when
HASH_HMAC is specified.

Fix this by exploting the fact that we can sneak an empty key past hash_init()
(on both Zend and HHVM) by sending it "\0" for a key value. "\0" and "" are
equivalent because the HMAC algorithm pads the key to the right with extra
zeros to the input block size of the hash function.

An empty key test vector is explicitly included in RFC 5869[1]. MediaWiki's unit
tests verify MediaWiki's HKDF implementation for conformance by using the
test cases that accompany the spec.

  [1]: http://tools.ietf.org/html/rfc5869#appendix-A.3
Closes #2988

Reviewed By: @ptarjan

Differential Revision: D1393731

Pulled By: @JoelMarcey
Clownlist __DIR__ test in joomla

Reviewed By: @ptarjan

Differential Revision: D1395347
Introduce kIntMapKind for IntMap array with only integer keys

Summary: This diff introduces a new ArrayKind kIntMapKind which has integer keys and is able to gracefully downgrade into a MixedArray. It templatizes the existing functions on MixedArray where necessary to raise warnings, and switches on the template parameter so that there should be no overhead for the kMixedKind case besides the extra code size.

Reviewed By: @paroski

Differential Revision: D1386055
Simplify remove_dir_recursive

Summary: I was going to add a check for if($target is in root dir), but that makes the whole block pointless.

Given that unlink() now works on orphan symlinks (?), I don't think it's needed

Reviewed By: @JoelMarcey

Differential Revision: D1394804
interface requirements : new lang feature [1/2]

Summary: This is the logical extension of trait requirements necessary
 to capture the "marker interface" pattern, wherein an interface is
 implicitly tied to a type hierarachy as with the following code:

   class Super {
      ...
      if ($this instanceof IMarker) {
        $this->methodOfMarker();
      }
      ...
   }
   ...
   function marked(IMarker $inst) {
     $inst->methodOfSuper();
   }
   ...
   interface IMarker {
     ...
     // new syntax to indicate that IMarker is only for children of Super
     require extends Super;
     ...
   }

 This diff ensures that the syntax is supported in the parser, but
 does not enforce the requirements (left to next diff).

Reviewed By: @paroski

Differential Revision: D1387181
interface requirements : new lang feature [2/2]

Summary: See part 1 (D1387181) for description of the feature. This diff enforces
 the 'require extends' requirements gleaned from interfaces. It does
 so via a partial refactor of the trait requirement enforcement that
 trades space (storing all requirements for a class) for time and code
 simplicity (no recursive calculations).

Reviewed By: @paroski

Differential Revision: D1387200
EZC: fix constness issue in zend_hash_*

Summary: Fix the issue identified by @jdelong regarding modification of array elements without proper COW handling:
* Use MArrayIter for all iteration, instead of integer positions. This allows modification of the value references.
* In ProxyArray, store the inner array inside a RefData, so that MArrayIter can find the inner array via the RefData.
* Make the RefData mutable so that it can be modified by read operations.
* Now that the RefData is mutable, reseatable() can be called on a const ProxyArray. But this is somewhat awkward when reseatable() passes through its return value -- the constness of the return value would have to match the constness of the parameter. Make it return void instead.
* Implement ZEND_HASH_APPLY_REMOVE -- trivial now that MArrayIter is used.
* Unimplement zend_hash_move_backwards_ex() on an external cursor -- MArrayIter does not implement reverse iteration.
* Add test for modification of array passed by reference
Closes #2961

Reviewed By: @ptarjan

Differential Revision: D1387901

Pulled By: @JoelMarcey
Make PrivacyPolicyBase covariant

Summary: Functions that return a `PrivacyPolicyBase` should have a return type of `this` that allows `getPrivacyPolicy` to be defined on Entish instead of an optional interface. This diff forces hack to think that `PrivacyPolicyBase` is covariant.

This diff is heavily based on D1287804.

Reviewed By: @jwatzman

Differential Revision: D1395604
Track pending deletes in APC via ODS counter

Summary: Expose APC pending deletes via treadmill to ODS

Reviewed By: @bertmaher

Differential Revision: D1391797