Allow class authors to customize the way debuggers display instances

If a class defines method __toDebugDisplay, the variable serializer will call it when serializing with DebuggerSerialize. The resulting value is added as property __PHP_DebugDisplay to the serialized object. If an object with such a property is serialized with DebuggerDump, the serialization of the property is used as the serialization of the object with the property.

Differential Revision: D954810
Disable quick/debugger/list.php

This test is flaky on some dev boxes. Disabling it until task 2558262 is implemented. That should get rid of the flakiness.

Differential Revision: D957673
provide run mode which runs all tests in mode matrix

Travis only supports running a single commandline to run tests so provide a
mode where we can run JIT+interp X repo+non-repo now that contributors are
starting to submit contributions that only break in repo mode.

Differential Revision: D957147
Fix updateTrackedState for StRef

It was using the wrong src number and always getting nullptr.

Differential Revision: D955583
Updating ext_string for benchmark optimizations

String optimizations, this gives us a 40% reduction in cycles for the revcomp benchmark.

Differential Revision: D934224
Add PHP_DEBUG constant

Just as it says on the tin.

Differential Revision: D958042
gcc -Wmaybe-uninitialized is too noisy

Summary: Disable -Wmaybe-uninitialized because it's noisy (even with gcc
4.8)
Assign php token constants based on actual lexer token values

Omit the values from constants.idl.json, and provide them
via hphp.tab.hpp.

Differential Revision: D957423
Delete unused hphpc list assignment code

Differential Revision: D959103
Fix stream_socket_recvfrom & stream_socket_sendto

IPv6 addresses for stream_socket methods in PHP must be bracket
enclosed.

Differential Revision: D958537
libmemcached support for all 0.4x+ versions

It turns out the Ubuntu 12.04 image I thought was using 1.0.16
was using 0.44 and OSX was using 1.0.17. This should fix compilation on
libmemcached 1.0.8 - 1.0.16.

Closes #1022

Differential Revision: D957901
Make test/run's finding repo compiler more robust

Use hhvm --hphp instead of hphp to find the repo compiler as it
is more portable

Differential Revision: D959508
Implement str_getcsv, and fix some fgetcsv related issues

str_getcsv is now just a wrapper around fgetcsv

Differential Revision: D958124
Improve substr zend compatibility

Fixed issues with negative and out of bounds start position
and length

Closes #1031

Differential Revision: D959015
Fix a bug in interpOutputType

We weren't properly handling OutCInput or OutCInputL.  In
practice this means if we interpOne an Unbox or CGetL3 of a reference
type we could generate code that will fail on a later run if it is not
monomorphic.

Differential Revision: D958269
remove config.hdf from test/slow

I keep adding tests in there and I hate that the warnings aren't in the output. This was pretty straightforward:

1) Delete the config.hdf
2) Run all the tests
3) `./tools/out2expectf.py test/slow/*/*.php test/slow/*/*/*.php`
4) `find test/slow -name "*.except" -exec rm {} \;`
5) Fix other broken things

The things I had to fix by hand were:
a) tests with invalid unicode in them that out2expectf choked on
b) tests whose output is too long for a .expectf file. Thankfully they didn't have any warnings.
c) `strtotime_leak.php` was somehow leaking with the default config
d) some tests are different in repo mode, I'm digging into those now

Differential Revision: D958390
Differential Revision: D959973
Check for capacity overflows when doing StringData geometric growth

It wasn't checking, which means you can make a string bigger
than StringData::MaxLen---the length you ask for in reserve() the
first time is compared with the max length, but you may end up with
more capacity than that and later calls are only checked against
capacity().  StringBuffer will also use this capacity as if it is
within range.  Also add a checkSane() assertion in the resize path.

Differential Revision: D954757
Use IRFactory& everywhere.

We were randomly using * and &, and sometimes even *const, to
pass around IRFactory pointers, which are never reseated.

Differential Revision: D958962
Fix crash when registering stream wrappers

Stream wrappers were not being destroyed properly at the end of
a request, resulting in strange behavior / crashes if the same wrapper
was registered across multiple requests. This affects Drupal. Sample
code:

<?php
class stream{
  public $name;
}
stream_wrapper_register("public", "stream");
stream_wrapper_register("private", "stream");
stream_wrapper_register("AA", "stream");
var_dump(stream_get_wrappers());

Closes #849
Closes #1032

Differential Revision: D959563
Fix pseudo-virtual dispatch of ToArray and Clone with collections

Turns out you can override collection classes, if you use the
__MockClass user attribute. We have to use instanceof instead of direct
m_cls comparison.

Also, not_reached() has surprising behavior in build configurations
where ##assert(false)## is a no-op -- because of the not_reached, the
compiler was optimizing out the final else-if branch of the chain,
assuming that it could only go one way. Replaced those
with ##always_assert(false)##.

The implementation of c_Pair::Clone wasn't quite right either -- it
wasn't checking for a user-defined __clone function. You have to go
really out of your way to observe incorrect behavior because of this,
but it's doable. Also the elm0 and elm1 members weren't necessarily
initialized (I think). This change can't hurt, anyway.

Differential Revision: D959327