Fix for mb function overload mb_substr acting different
bug #1453 Fix for mb function overload mb_substr acting different (1emming)

This PR was squashed before being merged into the 1.16-dev branch (closes #1453).

Discussion
----------

Fix for mb function overload mb_substr acting different

When bug hunting https://github.com/fabpot/Twig/issues/1428 I ran into an issue.
I started out by changing my `php.ini` for the `cli` enviroment, I've added:
`mbstring.func_overload = 2`
Later I tested with adding and removing:
`mbstring.internal_encoding = 'UTF-8'`

It turns out `mb_substr` returns `false` and not `''` when doing something like this:

```php
$item = '';
$start = -1;
$length = 1;
$charset = 'UTF-8';
$a = mb_substr($item, $start, $length, $charset);
var_dump($a);
die;
```

I'm not sure this will fix 1428 since I don't have enough information for this, but this PR should at least fix one issue.

Commits
-------

214fe52 Fix for mb function overload mb_substr acting different
Fixed the `matches` operator code example

It wasn't working because the backslashes themselves needed to be escaped by additional backslashes. Also switched to using forwardslashes for the regex delimiters rather than curly brackets.
minor #1457 Fixed the `matches` operator code example (brandonkelly)

This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed the `matches` operator code example

A customer just pointed out that your `matches` operator code example wasn't working for them, and it ended up being because its backslashes themselves needed to be escaped by additional backslashes. (I've verified this.)

While I was editing it, I also switched to forwardslash delimiters on the regex, since those are much more commonly used than curly brackets. (I hadn't even been aware that curly brackets are allowed.) To back that assertion up, [PHP's official preg_quote() docs](http://php.net/manual/en/function.preg-quote.php) state:

> The `/` is the most commonly used delimiter.

Commits
-------

33dcbc8 Fixed the `matches` operator code example
add variables types in error message of twig_array_merge
Simplified Twig_Node_Include
Fix type hint

PHPStorm wrongly inferred the type 'Unicode'
Fix type hint

In PHPStorm the inferred type was 'A'
Remove unused var
Remove unused local vars
Get rid of naming clash

Static code analysis tool did not like this.
Looks like it was wrong before. Tests unchanged though.
Restore unused var
minor #1458 Add variables types in error message of twig_array_merge (inalgnu)

This PR was merged into the 1.16-dev branch.

Discussion
----------

Add variables types in error message of twig_array_merge

Commits
-------

ea6676d add variables types in error message of twig_array_merge
minor #1462 Simplified Twig_Node_Include (hason)

This PR was merged into the 1.16-dev branch.

Discussion
----------

Simplified Twig_Node_Include

Commits
-------

632fe90 Simplified Twig_Node_Include
minor #1465 Some minor cleanup (JeroenDeDauw)

This PR was merged into the 1.16-dev branch.

Discussion
----------

Some minor cleanup

Commits
-------

e6da6bb Restore unused var
d8e1077 Get rid of naming clash
3e50672 Remove unused local vars
291141f Remove unused var
9921554 Fix type hint
1d2b877 Fix type hint
fixed the attribute() function when passing a variable for the arguments
added more docs for the if tag
Fixed 'starts with' operator for empty needle
bug #1452 Fixed 'starts with' operator for empty needle (hason)

This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed 'starts with' operator for empty needle

Fixes #1432

Commits
-------

790305a Fixed 'starts with' operator for empty needle
Fixed "starts with" a "ends with" operators for non-string arguments