get ready for ZendCompat classes

This turns off the `ZendCompat` classes at runtime just like we do for functions.

Reviewed By: @paroski

Differential Revision: D976049
collections: set-like-array return value from Set::toArray

Set::toArray returns `array(val1 => val1, val2 => val2, ...)`. This
maintains set-like semantics in array() land: O(1) membership test
with `array_key_exists($key, $a)` or `$a[$key]` and iteration with `foreach($a as
$member)`. Int-like strings end up with numerical array keys.

For nice symmetry, the results of `$s->toArray()` are the same as those of
`array_combine(array_keys($s),array_values($s))`

Reviewed By: @paroski

Differential Revision: D970064
Update array_keys(), array_values(), array_combine() to support collections

Reviewed By: drussi

Differential Revision: D974413
update materialize_methods test for Set->toArray() change

... should fix cont build

Reviewed By: @markw65

Differential Revision: D980893
Don't warn on include'd files that are empty

We currently emit a "File not found" warning on empty files that
are include'd, whereas Zend PHP is silent.

Reviewed By: @markw65

Differential Revision: D977274
Regard unimplemented functions an non-existant

This can happen when a function is declared
in systemlib, but not implemented in cpp.

Reviewed By: @ptarjan

Differential Revision: D976157
Fix Set::toKeysArray() and Set::toValuesArray()

Reviewed By: @elgenie

Differential Revision: D981442
support objects in zend compat layer

everything in here was needed to make the oauth extension work

Reviewed By: @paroski

Differential Revision: D976237
import oauth extension (take 2)

redoing this after the revert

Reviewed By: @paroski

Differential Revision: D976056
hphp: replace ENABLE_ASAN with FOLLY_SANITIZE_ADDRESS

FOLLY_SANITIZE_ADDRESS is automatically enabled via the

Reviewed By: @scannell

Differential Revision: D978198
Fix OSX build

OSX build is broken, fix it

Reviewed By: bertrand

Differential Revision: D981730
Use in memory structures for debug line info

This diff removes the last direct uses of SQL queries for mapping source line information to byte code offsets.

Reviewed By: @mikemag

Differential Revision: D980213
SimpleXML attribute mismatch

Fix issue and add test re: child attributes not matching upon
return from addChild and enumerating directly. This breaks two other
tests, but these are of lower priority.

Reviewed By: @ptarjan

Differential Revision: D982083
Support unions with specialized types in JIT::Type

This diff adds support for types like {Obj<C>|InitNull}, including all
the operators we have defined on Type. It's necessary in an upcoming region
translator diff. It's not currently used for anything but I thought it was
worth pulling out into a separate diff because of the complexity.

Reviewed By: @jdelong

Differential Revision: D973156
Silence warning for $result = $bad[$key] case when HHSyntax is off

Zend PHP emits warnings for:

  * $bad[$key] = ...;
  * $result = ($bad[] = ...);
  * $result = ($bad[$key] op= ...);

but not the title's case. The warning we emit prevents phpBB and
Drupal from installing.

Reviewed By: @markw65

Differential Revision: D981223
Update the OSS PHP Framework test script to support more tests and to support the downloading of Composer and PHPUnit

The OSS PHP Framework test script now supports more tests. Added a custom test command field to tests that don't use the vanilla "phpunit" command to run the tests. Also the code now downloads Composer and PHPUnit instead of relying on them being available in our repo.

Future updates:

- Support the rest of the tests in the tests map
- Support our test/run framework

Reviewed By: @sgolemon

Differential Revision: D981565
Remove HHIRSimplificationMaxBlocks workaround.

This used to work around a bad O(N^2) blowup in TraceBuilder, but
the blowup was fixed by D830913.  Removing the workaround.

Reviewed By: @jdelong

Differential Revision: D980277
Fix post-conditions for stack values

There were a couple of bugs that this diff fixes:

1) Relative SP offsets were being used although the SP was being
adjusted. This was fixed by keeping the post-conditions for stack
values relative to FP, and by keeping the SP offset relative to FP in
each Block.  While doing this, I also realized that the region
translator was always using the live SP offset, so I fixed it to use
the SP offset for it's first block.

2) Values with types Gen and None were being dropped from the
post-conditions, with the effect that older values would be kept in
the accumulated post-conditions during hottrace region selection. I
changed getStackValue so that it only returns None for values that
were neither guarded nor written in the IR trace, and only these are
omitted by getKnownTypes.

3) The accumulated post-conditions was keeping stack values after they
had been popped.

Reviewed By: @swtaarrs

Differential Revision: D972665
Add assertions that smart_free's are actually from smart_malloc

Also, I think it's hard to imagine the assert that iterates
the slabs hitting when the magic one doesn't, so I removed that in the
name of debug perf.

Reviewed By: @markw65

Differential Revision: D976926
stop changing the zend directory structure

I tried to make life nicer for us by having just a flat level of directories, but it turns out lots of zend tests depend on their directory structure. I think we should give up and just exactly mirror them.

Closes #1081

Reviewed By: @markw65

Differential Revision: D981964