check for fun('Foo::bar')

Summary: Pretty much anything can happen inside a string. We might
 want a check for "valid function name", but the most common error,
 using fun on a class method, deserves its own error, because it works
 in the runtime with ##call_user_func##, but not with direct
 invocation using ##$f()##.

Reviewed By: @jwatzman

Differential Revision: D1400880
better targeting of parent::__construct onto traits

Summary: ... looking at ##req_extends## when calculating the parent
 constructors that need to be called is excessive for the required
 check that a trait with a ##__construct## indeed calls its parent (since
 there's no ##parent::__construct## that can access a trait's constructor).

Reviewed By: @jwatzman

Differential Revision: D1401948
modify builtin_functions.hhi with additional annotations

Reviewed By: @jwatzman

Differential Revision: D1397403
Small doc fix for ResourceData vs. SweepableResourceData

Summary: Closes #3031

Reviewed By: @ptarjan

Differential Revision: D1402926

Pulled By: @JoelMarcey
wddx_deserialize() systemlib improvements

Summary: * Use stream_get_contents() instead of a loop of fgets(). Loops that read files are deceptively tricky -- it's possible to hit an error in which fgets() permanently returns false but with feof() being false, for example NFS server failure, which would cause an infinite busy loop with the previous code.
* Do not accept SimpleXMLElement objects as input -- this was a hack to allow recursive parsing without creating another global function. Achieve the same ends using a closure instead.
* Do not attempt to call $packet->getName() on any input that is not a string or resource. Instead mimic Zend and give a warning.
* Check for errors from simplexml_load_string(), instead of giving a fatal error due to calling false->xpath().
* Ignore malformed input in various cases, skipping array members etc., instead of assuming the XML is always perfect and inevitably hitting a fatal error due to invalid method calls. This is somewhat similar to what Zend does -- probably not identical though.
* Added a test case for malformed input based on the motivating unit test from MediaWiki.

Applied formatting patch from: http://noc.wikimedia.org/~ori/pr2991-fixups.patch

Closes #2991

Reviewed By: @ptarjan

Differential Revision: D1397192

Pulled By: @JoelMarcey
DirectoryIterator throws RuntimeException on empty string

Summary: Fixes zend/bad/ext/spl/tests/DirectoryIterator_empty_constructor.php but I can't move it because of the different representation of uncaught exceptions

The included test is a duplicate of the one above, but with a try-catch block
Closes #3001

Reviewed By: @ptarjan

Differential Revision: D1396928

Pulled By: @JoelMarcey