Autocomplete - Pass Typing_env to AutocompleteService when completing ID

Summary: This makes it so that when we're completing inside a function call param and completing a function name, we get ranked results.

Reviewed By: @jwatzman

Differential Revision: D1413659
Implemented xdebug_call_class

Summary: Depends on D1388555.

This diff implements the xdebug function xdebug_call_class.
If function Foo::g calls function f and function f calls xdebug_call_class,
the class name "Foo" is returned.

Reviewed By: @fredemmott

Differential Revision: D1388750
Fix more "newtype as" issues

Summary: @dlreeves found a few more places that we need to unwrap a
`newtype X as Y`. This is probably going to be whackamole for a little
while unfortunately. @pikatchu suggested I add the `Tabstract` case above
any `Tgeneric` case, but there's a //lot// of them, and I think this
approach is somewhat less messy.

Reviewed By: @pikatchu

Differential Revision: D1414279
Fix DataBlock overflows

Summary: The relocation code was bypassing runtime checks for overflowing
DataBlocks in opt builds (there was still an assert for dbg builds). This
rewrites it to relocate into a DataBlock instead of into a range of memory.

Reviewed By: @ottoni

Differential Revision: D1415998
move temp dir base name to var

Summary: Move temp directory base name to config variable.

Reviewed By: @jwatzman

Differential Revision: D1416220
Fix array_multisort to allow for first arg that can't be taken by reference

Summary: array_multisort accepts any non-zero number of arguments, and for all of
its varargs (everything except the first arg) it tries to take each
vararg by reference but allows varargs that can't be taken by reference
(for example, an array literal). However, HHVM's implementation of
array_multisort erroneously fatals (if called directly) or warns (if called
via call_user_func_array()) if its first arg cannot be taken by reference,
which differs from PHP5.

This diff fixes HHVM's implementation of array_multisort to allow its first
arg to be something that can't be taken by reference without raising any
warnings. It also fixes the "call_user_func_array('array_multisort', $args)"
use case so that it does not raise a warning if the first element in $args
is not a reference.

Closes #1486

Reviewed By: @ptarjan

Differential Revision: D1412141
Have hh build handle out-of-date server better

Summary: Handle version skew a little better.

Reviewed By: @aryx

Differential Revision: D1419020
Unbreak make bin on darwin

Summary: I broke the code that copies hh_server to ../bin on OS X. This fixes
it.

Reviewed By: @jwatzman

Differential Revision: D1407388
Casting Closure to Array

Summary: When casting an object of type Closure to an Array, the result should be an array containing the closure.

Reviewed By: @fredemmott

Differential Revision: D1411182
Update gdb/hhvm.py for conversion of PreClass::m_name to LowStringPtr

Summary: PreClass::m_name was converted from StringData* to LowStringPtr in
ab9494c3c. Also add fixme for the removal of IndexedStringMap::m_vec,
which broke the ObjectData printer, and add a workaround to avoid an
exception.
Closes #3075

Reviewed By: @ptarjan

Differential Revision: D1413647

Pulled By: @LiraNuna
Improved Zend compatibility in the reflection API.

Summary: * `inNamespace()`, `getNamespaceName()`, and `getShortName()` should not be
   `final`. This was causing issues in phpspec which mocks these methods.
 * Added missing `ReflectionFunctionAbstract::getClosureScopeClass()` and
   `ReflectionFunctionAbstract::__clone()`.
 * Removed abstract `ReflectionFunctionAbstract::getClosure()` as it's not in
   the Zend API meaning userland classes extending `ReflectionFunctionAbstract`
   are unlikely to implement it.
 * Made `ReflectionFunctionAbstract::isClosure()` non-abstract as it's not
   abstract in the Zend API.

Added tests for mocking `inNamespace()`, `getNamespaceName()` and `getShortName()`.

Closes #3070

Reviewed By: @fredemmott

Differential Revision: D1411359

Pulled By: @LiraNuna
Fix breakage of DSO loading on all platforms

Summary: bc00a9937 fixed a spelling error, but failed to fix the accidentally inverted logic, meaning that instead of underscores being unconditionally omitted, they would instead be added when they are not needed, and omitted when they are needed.

Exit statuses are hard. Used EXIT_SUCCESS/EXIT_FAILURE in the hopes of making the code readable.
Closes #3104

Reviewed By: @paroski

Differential Revision: D1419880

Pulled By: @jwatzman
Use default syntax in _php_mb_regex_ereg_search_exec

Summary: `_php_mb_regex_ereg_search_exec` was using an invalid syntax (`NULL`) and that ended up with a segfault whenever it was used.
Fixes #3111

Reviewed By: @ptarjan

Differential Revision: D1420000
Link libzip from where it's found, not from unspecified

Summary: Passing the full path to the target lib ensures the
right linker flag is set.

Reviewed By: @ptarjan

Differential Revision: D1418348
Expose APC info to admin port and via apc_cache_info() to give open source too a visibility over APC

Summary: expose APC info via apc_cache_info and admin port

Reviewed By: @markw65

Differential Revision: D1405003
EZC: add fixme for zend_call_method
Fix boundary cases of strspn, strcspn and substr_replace

I'm all for refactoring, but a precondition for refactoring is that the
original copies of the code in some way resemble each other. While the
bounds checks for strspn, substr_replace and substr might look
superficially similar, in fact they can't be merged with a single
simple if(strict) to take care of the divergence. The main problem is
that multi-pass normalization of the inputs gives you some interesting
and arguably broken behaviour when there are multiple issues that need
to be simultaneously fixed.

So, unrefactor (expand?) string_substr_check() into its three
consistutent parts, with code in the two new parts based closely on the
Zend source in the current git master. Remove the "strict" parameter,
now implicitly true.

Added a test case which previously failed in multiple ways. In
particular, strspn('','x') returned the wrong thing, which broke the
MediaWiki parser quite badly. The expect file was generated by PHP 5.5
and is identical to the one generated by PHP 5.3.

Submitted on behalf of a third-party: The PHP Group
Source: PHP 5.6.0-dev
License: version 3.01 of the PHP license
Support stream wrappers in XML parser extensions

Closes: #2829
Use timeout from GNU coreutils instead of bash hack

When using timeout.sh to run tests, test execution hangs until the
"sleep 1" finishes, probably because the monitor process keeps
filehandles open. If you instead use timeout from GNU coreutils, test
execution is about 2.5 times faster -- I measured a drop from 75 to 30
seconds for test/quick.
Don't use -Og

It is annoying. Not for upstream.