Add test for PHP subclass type strictness behavior

Summary: lolwut

Reviewed By: @ptarjan

Differential Revision: D1347668
Ignore /bin

Summary: Folder is generated by cotire
Closes #2755

Reviewed By: @fredemmott

Differential Revision: D1348999

Pulled By: @JoelMarcey
Truncate regions before type assert opcodes

Summary: analyze() was doing this but the tracelet selector wasn't. Luckily
it's a super simple fix. This was causing us to miss out on some type
information from hhbbc.

Reviewed By: ottoni, jdelong

Differential Revision: D1347717
Convert null_object/resource references

Summary: We've been using null_* when we really want to just return an
empty/new Object/Resource/String/Array. This is in preparation
for a codemod that will convert these sites to null_foo_value but gets
the short-term win. Handle Variant in a separate diff because it of the
semantics.

Reviewed By: @markw65

Differential Revision: D1344569
CMake: install headers under DESTDIR

Summary: The relatively new HHVM_INSTALL_HEADERS function has some special code
to recursively copy files to the target, using file(COPY ). However,
file(COPY) does not by default prefix with DESTDIR and would install the
headers into the system paths, instead of under the supplied destination
directory.

Change the function to prefix the target with $ENV{DESTDIR} to fix this.

This matters especially for downstream packagers, as packages usually
build by running "make install" using a DESTDIR, then packaging that
directory up. Without this, compilation would fail, as the build system
would attempt to install in a privileged system directory.
Closes #2777

Reviewed By: @fredemmott

Differential Revision: D1349240

Pulled By: @JoelMarcey
Remove CMake/FindLibEvent.cmake.bak

Summary: CMake/FindLibEvent.cmake.bak is presumably a backup file from an older
version of CMake/FindLibEvent.cmake that has been commited by accident
during the initial open-source release (commit c3f1ab2).

Remove it as it's obviously redundant.
Closes #2776

Reviewed By: @fredemmott

Differential Revision: D1349226

Pulled By: @JoelMarcey
Convert Variant references

Summary: Use init_null() when returning Variant, and uninit_null() when
returning Variant() to make intent more clear and save some work.

Reviewed By: @markw65

Differential Revision: D1344927
Kill AsyncFunctionWaitHandle::{get,set}PrivData()

Summary: Kill unused m_privData in AsyncFunctionWaitHandle. Does not save any memory
because of 16-byte alignment.

Reviewed By: @billf

Differential Revision: D1344989
Fix test/quick/redeclared_function.php.expectf

Summary: The path was too specific

Reviewed By: aravind

Differential Revision: D1349678
cut session_id() size by 1/2

Summary: We were converting it to ascii hex first, then converting that to the final encoding they ask for. Lets stay in binary until the final encoding.

Closes #1884

Reviewed By: @JoelMarcey

Differential Revision: D1347195
don't kill shutdown functions when you want a session one

Summary: Closes #2725

Reviewed By: @fredemmott

Differential Revision: D1347393
Some eta conversion cleanup

Summary: Saw it, didn't like it.

Reviewed By: @swtaarrs

Differential Revision: D1349390
Add a catch trace to ArraySetRef

Summary: We can throw if the array becomes unbalanced.

Reviewed By: @bertmaher

Differential Revision: D1322832
Fix dbgo build bugs with clang

Summary: Signed integer overflow is undefined, and clang's optimizer seems quite
eager to take advantage of this fact. It's interesting to see how many
wrong ways there are to detect it.

Also, we weren't dealing correctly with bools returned from C++ in one
spot.

Reviewed By: @markw65

Differential Revision: D1349363
Simplify LdBindAddr

Summary: A rip-relative load is actually smaller than a baseless load,
since it doesn't need the SIB byte; and its always better than an 64-bit
move immediate, followed by a load.

Reviewed By: @swtaarrs

Differential Revision: D1349138
CMake links based on .so presence instead of header detection

Summary: The build system is a bit naive and picks linker arguments based on the presence of libraries (shared objects) and not based on the library choice that was made earlier which in turn, was based on the availability of development headers.

This has the effect that if you have both libedit and libreadline installed on the system but only libedit-dev, HHVM will get built with the libedit headers but linking will be attempted against libreadline which will obviously fail. This is particularly important since libreadline is typically available on systems, but we want to prefer linking against libedit for licensing reasons.

On the Debian packaging I've worked around this with the following patch which is just a hack: it just swaps the order or libedit/libreadline. While it doesn't fix the true bug, it may be sensible considering the licensing implications of linking with libreadline (PHP/GPL mixture = undistributable) and the wide availability of libreadline on systems.

The real bug here is the total disconnect between header detection/library choices and linking arguments and remains even after this patch.
Closes #2778

Reviewed By: @ptarjan

Differential Revision: D1349261

Pulled By: @JoelMarcey
Support var_dump()/print_r() from DOM

Summary: Add __debugInfo() magic methods and dump props

Closes #1882

Reviewed By: @ptarjan

Differential Revision: D1350225
allow usage of zend-qsort in user sorts with a runtime option

Summary: uasort/usort don't impose a strict order, and because HHVM and PHP use a
different sorting algorithm this means that in some cases we can end up
with different results.

This commit allows us to fall back to standard zend qsort behavior
(which is used by Array::sortImpl) when doing sorting through user-defined
compare functions.

More information can be found in an earlier (incorrect) pull request:
https://github.com/facebook/hhvm/pull/2484#issuecomment-42093840

If you have any questions, paroski should be able to clarify.

Fixes 5 zend tests, and closes the following github issues:
Closes #2484.
Closes #2416.
Closes #1781.
Closes #2749

Reviewed By: @ptarjan

Differential Revision: D1347291

Pulled By: @JoelMarcey
Convert ext/standard/output to HNI

Summary: Part of #1480
Closes #2760

Reviewed By: @sgolemon

Differential Revision: D1349032

Pulled By: @JoelMarcey
Fixed Memcached::getAllKeys().

Summary: Closes #2767

Reviewed By: sgolemon, fredemmott

Differential Revision: D1349083

Pulled By: @JoelMarcey