Fixed PHP-717: (Almost) All tests leak and has a unconditional jump

The conditional jump is because the length of the string is off-by-one

The memory leak is caused by having two arguments of the same name, and
is a bug in PHP (see https://bugs.php.net/bug.php?id=64515)
Merged pull request #337