Find and move good zend tests in the bad folder

Summary: This script finds good test in the zend/bad folder and moves them to zend/good

I ran it and included the moved tests in here.

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

Reviewed By: @sgolemon

Differential Revision: D1444261

Pulled By: svcscm
Remove reflection hacks for primitive typehints

Summary: When updating how primitive typehints worked, some hacks were done to strip
the "HH\" prefix from the output of various refleciton methods. These hacks
shouldn't be needed anymore. This diff removes the hacks and fixes up
ReflectionParameter::getClass() to be aware of the 'num', 'resource',
'mixed', and 'void' typehints.

Reviewed By: @elgenie

Differential Revision: D1253815
Changed grammar mistakes @rkulagowski found in --help

Summary: Fixes #3334

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

Reviewed By: sgolemon, ptarjan

Differential Revision: D1471012

Pulled By: svcscm
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