Improve readability of comments for lookupMethodCtx()

Reviewed By: @edwinsmith

Differential Revision: D1473040
Clean up lint in move_good_tests.py

Summary: Apply suggestions from https://reviews.facebook.net/D20205

Reviewed By: @LiraNuna

Differential Revision: D1473059
Fix GMP test

Summary: This didn't make it into the last pull; sorry!

Closes https://github.com/facebook/hhvm/pull/3343

Reviewed By: @ptarjan

Differential Revision: D1472912

Pulled By: svcscm
Move readfile_variation6.php to flaky

Summary: Move readfile_variation6.php to flaky/ since it uses files used by other tests

Reviewed By: @fredemmott

Differential Revision: D1473626
Imported needed xdebug files

Summary: This diff directly imports some xdebug code in the directory
`runtime/ext/xdebug/php5_xdebug` as well as in
`runtime/ext/xdebug/xdebug_utils.*`.  Right now, this includes the files
for xdebug strings, xdebug xml, and xdebug memory allocation. I've modified
it to compile in c++, I've removed and replaced dependencies, and I've changed
the style enough to get the linter to stop complaining.

I've written TODOs in each of these files to abstract and refactor
these files. This is low-pri, but I do think it's worth being on the list of
things to do for maintainablity purposes. As I'm sure you will see, the code is
hard to follow, it's verbose, and malloc and free are used worryingly liberally.

The threat of creating potential memory leaks due to the required manual
mallocing/freeing when modifying code is probably my biggest worry. I don't think
cleaning these up will be a huge task, as I've ensured they're as modularized as
possible.

Reviewed By: @ptarjan

Differential Revision: D1471865
Add norepo file if test does not pass

Summary: The test runner only added .norepo files if the tests pass. This diff changes the behavior to keep the .norepo file even if the tests fail or are flaky.

Reviewed By: @ptarjan

Differential Revision: D1473808
Added function imagepalettecopy to ext_gd

Summary: Closes #3338

Closes https://github.com/facebook/hhvm/pull/3344

Reviewed By: @sgolemon

Differential Revision: D1474062

Pulled By: svcscm
fix mb_convert_case when encoding set other than default

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

Reviewed By: @ptarjan

Differential Revision: D1447241

Pulled By: @sgolemon
Added functions imagewebp and imagecreatefromwebp

Summary: This PR implements the functions imagewebp and imagecreatefromwebp.

https://github.com/facebook/hhvm/pull/3330
Closes #3141.

Reviewed By: @ptarjan

Differential Revision: D1470972

Pulled By: @sgolemon
Correctted flaky test to not be flaky

Summary: Makes a flaky test not flaky

Reviewed By: @ptarjan

Differential Revision: D1474165
Support collections for third parameter of preg_replace() and friends

Summary: Before this diff, a collection passed as the third parameter to
preg_replace(), preg_replace_callback(), and preg_filter() would be cast to
a string, which is not the behavior one would expect or want. This diff
changes these builtins to treat a collection passed as the third parameter
the same as an array.

Reviewed By: @asukhachev

Differential Revision: D1472101
mark posix_kill_basic flakey

Summary: It failed on my bellwether diff

Reviewed By: @JoelMarcey

Differential Revision: D1474394
break out hhvm request timeout / memout counters for psp vs non-psp

Summary: break out hhvm request timeout / memout counters for psp vs non-psp

Reviewed By: @bertmaher

Differential Revision: D1474528
Clean up some tracing and asserts

Summary: I added all of this while debugging various issues and figured it'd be
generally useful.

- Convert unwind.cpp to use ITRACE.
- Assert that spoff is correct on tracelet entry.
- Use visitStackElems to verify stack contents in checkFrame.
- Fix RBTrace codegen for code relocation by using rip-relative lea

Closes https://github.com/facebook/hhvm/pull/3219

Reviewed By: @bertmaher

Differential Revision: D1443194

Pulled By: @swtaarrs
make it possible to log per request if oom or timeout triggered in dynostats

Summary: make it possible to log per request if oom or timeout triggered in dynostats

Reviewed By: @bertmaher

Differential Revision: D1474569
Fix race condition in DebuggerProxy start/stop

Summary: hphpd is sometimes crashing while calling pollSignal() on an already
destructed DebuggerProxy from an AsyncFunc.  (This manifests as a pure
virtual call to ThriftBuffer::flushImpl()).

It looks like there's a potential race condition where we might stop the
proxy and clean it up after we've added it to the Debugger's map, but
before we've actually started it up.  Let's fix this and hope it fixes
the crash also.

Reviewed By: @markw65

Differential Revision: D1468019
Fix LowPtr load in codegen

Summary: Use emitLdLowPtr().

Reviewed By: @swtaarrs

Differential Revision: D1475166
Support stream wrappers in XML parser extensions, add external entity loader

Summary: * Support stream wrappers in SimpleXML, DOM and XMLReader input and
  output filenames.
* Rename libxml_input_buffer() to libxml_create_input_buffer().
* Implement userspace function libxml_set_streams_context(), was
  previously missing.
* Since the VM can now be re-entered during parsing, with libxml2 in the
  call stack with -fomit-frame-pointer, all XML parsing functions must
  be protected with SYNC_VM_REGS_SCOPED().
* In DOMDocument, don't do File::TranslatePath() on input filenames,
  since they can now be URLs, and translation is now redundant with that
  done by FileStreamWrapper.
* In simplexml_load_file(), call xmlReadFile() instead of
  f_file_get_contents(), so that the libxml default stream context is
  used. Almost fixes test/zend/bad/ext/libxml/tests/bug54440.php, except
  for a minor error handling issue that should be dealt with by GitHub
  PR #2376.
* In stream_context_create(), return a default stream context resource
  when the options fail validation, instead of returning false. This
  matches the PHP behaviour and makes
  hphp/test/zend/bad/ext/libxml/tests/bug63389.php pass.
* Move passing tests to hphp/test/zend/good
* Add test.xml, copied from PHP 5.6.0-dev, needed by a passing test.
* Add an external entity loader. This allows the use of "data:" and
  "compress.zlib:" in entities and URIs.

Since loading external entities exposes a number of security issues including
remote shell execution, it's disabled by default (except for the data: protocol
which isn't actually external). The new config option is documented in
doc/inconsistencies.

Closes: #2329
Closes: #2829

Reviewed By: @ptarjan

Differential Revision: D1468180
fixed using []s in ini settings

Summary: Ini setting arrays were not being incremented properly when the push back syntax was used i.e. extensions[] = "foo.so". The folly::dynamic isInt() function does not check if a type can be converted to an it only if it is currently an int. Unfortunately, there does not appear to be a way to test this other than trying to convert the string to an int and catching the error. It appears there are two options, either we catch the exception (what I implemented) or we just insert the new key as an int. The latter seems like a poor choice because when the setting is later Get()ed any user defined numerical offsets will conflict with our internal numbers and one of the two would dissapear.

Reviewed By: @ptarjan

Differential Revision: D1474402
Revert "Optimize APC objects and collections by defining an APCCollection class and increasing the number of APCObject vs serialized objects"

Summary: This reverts commit 9678712bfce1bdd3b607feb7dd2328410dc45331.

This is being reverted because it doesn't quite respect the behavior for
__sleep().

Reviewed By: alexanderm, bertrand, smith

Differential Revision: D1475357