Add CachingIterator

- Implement CachingIterator
- I ran the idl/sysdoc.php script on my file but it didn't do anything to it
- I started with https://github.com/php/php-src/blob/master/ext/spl/internal/cachingiterator.inc and then added everything that it was missing
- Some of the documentation at http://www.php.net/manual/en/class.cachingiterator.php is strange. All the offset function say that they take string arguments. But the class implements ArrayAccess which specify the arguments as mixed. So I went with mixed because otherwise I got a fatal
- I moved over all bad tests that are now passing
- The rest of the bad tests that test CachingIterator are passing too. It is just that error messages are different so I can't move them to good

Differential Revision: D942889
Handle $a[] = 1

- This is how Zend does it. If $index is null treat it as no $index at all

Differential Revision: D943043
Use "Packed" as the term for vector-like arrays.

The term Vector is getting too overloaded in our codebase.  Rename
vector-like array kinds to "packed" instead.

Differential Revision: D935245
Refactoring member-operations so each kind of base has its own function

I liked the results of some cleanup of SetNewElem, so I
decided to extend it to many of the other Elem* functions in
member-operations.h.  This diff really just moves code around to make
it easier to experiment with in the future.

Differential Revision: D932351
Use StringData::same() in a few more places to reuse code.

Now that same() has a faster comparison loop than memcmp,
use it in a couple more places.

Differential Revision: D942902
use apt-fast instead of apt-get to speedup build
run all downloads in background and in parallel
Merge pull request #994 from staabm/apt_fast

speedup travis ci build using apt-fast and paralleled downloads
Rename _ to - in hphp/util

One more step in the renaming arc.
Depends on D925182

Differential Revision: D927227
Devirtualize ObjectData, part 1

The C++ vtable pointers and the m_cls pointers in ObjectData are
redundant for C++ extension classes; they both indicate the ObjectData's
dynamic type.

This diff gives ObjectData the same treatment that the ArrayData
hierarchy got, replacing virtual functions with manual dispatch based on
attributes and m_cls. We can't do direct comparison against m_cls,
because of inheritance, except when we know inheritance is not in the
picture.

The vtable isn't gone yet, because I need to do something about C++
destructors, which still require virtual dispatch. That's going to
require a lot of grunt work, so I wanted to put this diff up to keep
that stuff separate.

I did, however, make ~ObjectData non-virtual and try to compile, to
flush out all the dynamic_casts of ObjectData.

- The type-casting functions and clone() are pretty straightforward. The
  only trick is that specialized clone() functions now have to call
  cloneImpl() instead of the base class' clone(), otherwise infinite
  recursion. I added an ObjectData attribute to indicate whether clone()
  is special.

- t___{sleep,wakeup} didn't even need to be virtual, it turns out.
  ObjectData's implementation goes through the normal PHP-method lookup
  path, which effectively does virtual dispatch and routes us to any
  specialized implementations anyway.

Differential Revision: D940852
Fix get_class_methods() to include trait methods

get_class_methods() was not including methods that came from traits.
This diff changes get_class_methods() to look at the Class' method
table, instead of the PreClass.  With this approach, we could avoid
traversing the inheritance hierarchy.  However, that changes the order
of the methods in the resulting array.  So, in order to preserve the
order, this diff still traverses the inheritance hierarchy, and
methods are added to the array when visiting the class that declared
them.

This modification changed the order of methods for some "quick" tests
with classes derived from builtin classes.  However, hhvm was not
matching Zend on these tests already, so I updated them.

Differential Revision: D940214
Move util/neo up one level

It defines its own library, remove the unnecessary nesting.

Differential Revision: D943068
Implement ReflectionMethod::setAccessible()

The unit tests for Composer require a call to ReflectionMethod::setAccessible(). This implements that method.

Differential Revision: D939166
Move util/parser up one level.

It defines its own library, make it a peer with other libs.

Differential Revision: D943071
Generalized Inlining

Generalizing inlining to work with more complex functions.

Differential Revision: D898434
Get rid of errant double-license
Move util/vixl up one level

Giving each lib/exe build target its own toplevel dir.

Differential Revision: D943470
Make hhir guard relaxation less conservative

This diff expands guard relaxation to relax all eligible
guards, not just guards for values that are never read. Specialized
types are still not supported yet; the tracelet region selector drops
all specializations.

Differential Revision: D934157
Support specialized types in the tracelet region selector

Most of the hard work to support specialized types was getting guard
relaxation working, so this diff is pretty straightforward. The only big change
is collapsing GuardCls and GuardArrayKind back into GuardLoc. If that turns out
to be a noticeable perf regression I can investigate other options.

Differential Revision: D936145
Clean up StringBuffer a bit

Privatize several public functions, remove some redundant
functions, make some things non-members (appendJSONEscape), remove
DECLARE_BOOST_TYPES, and document contracts; also some gratuitous
style changes.  I was initially planning to make it include the null
in its capacity, but since capacity is not exposed anywhere I think
it's fine as is.  (And eventually we don't want to require the null
when handing off to String---only when people call data()---but that
is a separate project.)

Differential Revision: D931746