Fix segfault with PHP 5.6 and interned strings

Signed-off-by: Remi Collet <fedora@famillecollet.com>
Merge pull request #2772 from remicollet/issue-56

Fix segfault with PHP 5.6 and interned strings