more flakey tests

Summary: 2 use the network and one uses a hard-coded port

Reviewed By: @JoelMarcey

Differential Revision: D1488544
Implemented stating/stopping xdebug remote server

Summary: This diff implements correctly starting/stopping the xdebug remote debug
server, including initializing/deinitializing the dbgp protocol. The xdebug
server supports all the configuration options available in php5 xdebug.

A lot of this code started as the php5 xdebug code and so most of
the flow corresponds 1:1 to php5 xdebug. However, the code was very heavily
translated- all lines required some change of varying degree.
So feel free to bug me about style/structure as my goal is to keep this file
clean.

What's missing is responding to commands. There are quite a few of these.
Before that, I need to refactor the debugging hook code to work with non-hphpd
debuggers.

Reviewed By: @ptarjan

Differential Revision: D1473636
Refactored debugger-hooks to support non-hphpd debuggers

Summary: This diff touches a lot of areas related to the debugger so I'd like
feedback on the approach.  @mikemag I asked in irc who to talk to about the debugger
and was told no one really owns the debugger, but to cc you.

This diff refactors `runtime/vm/debugger-hooks` to support non-hphpd debuggers.
This is specifically important for xdebug, but the problem presented is the same
regardless of the debugger;. To add xdebug remote debugging, I would minimally
need to 1. hook into the debugging hooks 2. manage state between hphpd and
xdebug. This does both by abstracting the debug hook logic into a
`DebugHookHandler`.

Now, a debugger can register for debug events (breakpoints, exceptions, errors,
file/class/function loading, etc.) by subclassing `DebugHookHandler`
and then calling `DebugHookHandler::<T>attach` where `T` is the subclass. The
`DebugHookHandler` class manages allocating/deleting the subclass, which is why
the template parameter is used.

I've added a new class `DebuggerHookHandler` that enables the use of hphpd
using this change. The implementation of `DebuggerHookHandler` was moved
directly from `debugger-hook.cpp` and I've changed calls to
`ThreadInjectionData::setDebugger` into calls to
`DebugHookHandler::attach<DebuggerHookHandler>()`. So other than added
indirection, there are no changes to hphpd and so nothing should break.

Reviewed By: @ptarjan

Differential Revision: D1474540
Gethostbyname on windows

Summary: use gethostbyname not gethostbyname_r on windows and add notes on windows oddnesses

Reviewed By: @sgolemon

Differential Revision: D1481313
Windows apis to retrieve name of symbol

Summary: Use apis available in dbghelp (available on all windows systems in many versions)
This uses only basic api calls so should be available no matter the version

Reviewed By: @sgolemon

Differential Revision: D1481204
found another location of hphp instead of hhvm

Summary: When we moved the lib directory to hhvm I missed the hphphize.in file.

Reviewed By: @LiraNuna

Differential Revision: D1488969
Fix include issue and asm definition on windows

Summary: Rearrange the per system blocks of macros for the assembly helper, and remove the .size declaration that pe/coff does not need

Reviewed By: @ptarjan

Differential Revision: D1482214
Warn when using miarray with array_multisort

Summary: array_multisort reorders integer keys, so we should raise a warning when used
with an miarray.

Reviewed By: @paroski

Differential Revision: D1489327
Clean up checked map array warnings and tests

Summary: This diff does the following:

-- Clean up warning messages to remove "converting to array" when it doesn't
-- Merge kExists* and kNvGet* warning message and change wording
-- Add take_by_ref.php test for msarray to match miarray

Reviewed By: @paroski

Differential Revision: D1488770
Remove dead code: defClsHelper

Summary: I looked quite a ways back and didn't find the last use being
removed; meh.

Reviewed By: @mxw

Differential Revision: D1488744
Warn when using checked map arrays with array_splice

Reviewed By: @paroski

Differential Revision: D1489522
Updated twig to 1.16.0 in the framework tests

Summary: The **current** twig tests differ from the expected output when run. This seams to be due to the numerical locale test. Maybe we should exclude that test? I have in my pull, and I've also updated us to 1.16.0.

The diff showing the flakey test **without** any of my modifications to the expected output or framework.yml:
```
----------------------
Twig_Tests_CompilerTest::testReprNumericValueWithLocale

RUN TEST FILE:  cd /root/hhvm/hphp/test/frameworks/framework_downloads/twig && /root/hhvm/hphp/test/frameworks/../../hhvm/hhvm -v Repo.Local.Mode=-- -v Repo.Central.Path=/tmp/framework-test8uvGFo --config /root/hhvm/hphp/test/frameworks/php.ini -c /root/hhvm/hphp/test/frameworks/.generated.php.ini /root/hhvm/hphp/test/frameworks/vendor/bin/phpunit --debug  -c /root/hhvm/hphp/test/frameworks/framework_downloads/twig/phpunit.xml.dist --filter 'Twig_Tests_CompilerTest::testReprNumericValueWithLocale'

EXPECTED: .
>>>>>>>
ACTUAL: S
```
Closes https://github.com/facebook/hhvm/pull/3370

Reviewed By: @fredemmott

Differential Revision: D1487074

Pulled By: svcscm
Flakeylist bad codeigniter test

Summary: assert(time() === time()) is racey.

Reviewed By: @JoelMarcey

Differential Revision: D1489350
Updated Doctrine In The Framework Tests

Summary: Replaces #3375. I still get `100%` passing tests as shown by the diff.
Closes https://github.com/facebook/hhvm/pull/3385

Reviewed By: @ptarjan

Differential Revision: D1488838

Pulled By: @fredemmott
Added Guzzle Streams To The Framework Tests

Summary: Replaces #3383. The streams repo is an integral part of guzzle 4 so we should test it.

Note that there is currently one failing test:
```
1) GuzzleHttp\Tests\Stream\AppendStreamTest::testCanReadFromMultipleStreams

RUN TEST FILE:  cd /root/hhvm/hphp/test/frameworks/framework_downloads/guzzle-streams && /root/hhvm/hphp/test/frameworks/../../hhvm/hhvm -v Repo.Local.Mode=-- -v Repo.Central.Path=/tmp/framework-teste78LeR --config /root/hhvm/hphp/test/frameworks/php.ini -c /root/hhvm/hphp/test/frameworks/.generated.php.ini /root/hhvm/hphp/test/frameworks/vendor/bin/phpunit --debug  -c /root/hhvm/hphp/test/frameworks/framework_downloads/guzzle-streams/phpunit.xml.dist --filter 'GuzzleHttp\\Tests\\Stream\\AppendStreamTest::testCanReadFromMultipleStreams'

Failed asserting that false is true.

/root/hhvm/hphp/test/frameworks/framework_downloads/guzzle-streams/tests/AppendStreamTest.php:116
/root/hhvm/hphp/test/frameworks/vendor/phpunit/phpunit/src/TextUI/Command.php:179
/root/hhvm/hphp/test/frameworks/ve
Closes https://github.com/facebook/hhvm/pull/3386

Reviewed By: @ptarjan

Differential Revision: D1487067

Pulled By: @fredemmott
Warn when using shuffle(...) on checked map arrays

Summary: The ##shuffle(...)## builtin destroys keys so it should raise a warning when
operating on a checked map array.

Reviewed By: @paroski

Differential Revision: D1489727
Introduce async function lambdas

Summary: Introduce lightweight way to define async function closures. Adds ability to prepend lambda functions with async keyword.

It also works with async generators!

Reviewed By: @billf

Differential Revision: D1402430
Added ext/reflection tests

Summary: This diff un-blacklists ext/reflection tests and imports them

Reviewed By: @fredemmott

Differential Revision: D1489330
Added ext/gmp tests

Summary: This diff un-blacklists ext/gmp tests and imports them

Reviewed By: @fredemmott

Differential Revision: D1489612
Imported ext/tokenizer tests

Summary: This diff un-blacklists ext/tokenizer tests

Reviewed By: @fredemmott

Differential Revision: D1489306