fix ob_get_contents return value

ob_get_contents returns false if not currently buffering output

Closes #1429

Reviewed By: @alexmalyshev

Differential Revision: D1110757

Pulled By: @scannell
Zend compatibility - stripslashes

Zend's implementation of stripslashes removes a trailing
backslash in a string, except in the empty string it is replaced by a
NUL. Prior to this PR, HHVM's implementation always replaced the
trailing backslash with a NUL. The reason is, HHVM unconditionally
appended the character following a backslash. When the string ends in
backslash, the following character is the null-terminator of the
underlying C-string.

This was identified because of a failing test in the WordPress test
suite.

Closes #1423

Reviewed By: @alexmalyshev

Differential Revision: D1110135

Pulled By: @scannell
Pass along error number when handling a fatal error

As no error number was being passed when a fatal error occurred, error_get_last() in a shutdown handler wasn't able to check if the error was fatal.

Closes #1408

Reviewed By: @alexmalyshev

Differential Revision: D1110032

Pulled By: @scannell
Change error exit code to be consistent with Zend

Errors now return -1 like PHP does.

Closes #1350
Closes #1405

Reviewed By: @ptarjan

Differential Revision: D1108693
Add ZendParamModeFalse

Add ZendParamModeFalse for chdir-like functions

Reviewed By: @ptarjan

Differential Revision: D1108735

Pulled By: @scannell
Make strrchr more compatible with Zend

The contract for strrchr is "If needle contains more than one character,
only the first is used". The implementation was using strrpos which
scans for the entire string, not just the first character, resulting in
an incompatibility. This PR request resolves that incompatibility.

Also, for the purposes of strrchr, zend treats the empty string as a NUL
character. This happens because the empty string is (apparently) handled
by the second rule for needle: "If needle is not a string, it is
converted to an integer and applied as the ordinal value of a
character."

Closes #1394

Reviewed By: @JoelMarcey

Differential Revision: D1108545

Pulled By: @scannell
Fixed setIteratorMode() in SplStack and SplQueue

setIteratorMode in SplStack didn't throw exception when mode
was invalid.

Closes #1426

Reviewed By: @alexmalyshev

Differential Revision: D1110182

Pulled By: @scannell
SplObjectStorage mutation fix

The current reimplementation of SplObjectStorage does not allow mutation
of "info" values attached to object keys in the case where the object is
already present in the object. This is inconsistent with PHP's behavior.

Closes #1388

Reviewed By: @ptarjan

Differential Revision: D1108349

Pulled By: @scannell
Fix SplDoublyLinkedList when using array syntax

If you append items to a SplDoublyLinkedList using array syntax
($foo[] = 'bar'), the tail would not be updated.

Example:

<?php
$stack = new SplStack();

$stack[] = "var1";
$stack[] = "var2";
$stack[] = "var3";

foreach ($stack as $var) {
    echo $var . "\n";
}

HHVM Output:

    var1

Correct Output:

    var3
    var2
    var1

Closes #1415
Closes #1421

Reviewed By: @alexmalyshev

Differential Revision: D1110142

Pulled By: @scannell
Fix ReflectionClass::implementsInterface with \

Fixed ReflectionClass::implementsInterface() with black slash
prefixed interface name

Closes #1424
Closes #1430

Reviewed By: @ptarjan

Differential Revision: D1110811

Pulled By: @scannell
Update NEWS for Appleseed

Reviewed By: @scannell

Differential Revision: D1110400
Fix ASAN tests

Fix use-after-free with imported systemlib module names

Reviewed By: @jdelong

Differential Revision: D1111011
Change eliminateRefcounts to convert instructions to Nops instead of erasing them

Otherwise the block may become empty and validation passes start to
complain.  It's simpler to just convert the instructions to Nop and
let DCE take care of cleaning things up.

Reviewed By: aravind

Differential Revision: D1109291
Strip generator's path info out of generated ini-parser file
Be honest, we're just not going to support 32bit.

The JIT specifically emits 64-bit x86 and will do so for
the forseeable future.
Rename CMake LibUODBC module.

Oops.  I misnamed it.
Some spring cleaning for the cmake file

Don't even check USE_HHVM/USE_HPHPC, hphpc died months ago.
HHVM_BINARY and HHVM_LIB_PATH_DEFAULT defines are no longer used.
HHVM_PATH is specific to test.
Remove the need to export HPHP_HOME when building

"Detect" HPHP_HOME as the location of the main CMakeLists.txt
file and plumb it through to child scripts from there.
Replace macros in Simplifier with templates

Replaces SIMPLIFY_{CONST,COMMUTATIVE,DISTRIBUTIVE} with templated
functions instead.

Reviewed By: @jdelong

Differential Revision: D1104151
Replace NoSurprise metadata with a JmpNS instruction

Just is easier to manipulate bytecode than metadata.  This
doesn't hook it up in hhbbc yet.  Also I removed surprise flag checks
from IterBreak: they aren't ever going to jump to loop heads.

Reviewed By: @markw65

Differential Revision: D1103402