fixes geraintluff/jsv4-php#10 and added the relevant unit test
Merge pull request #12 from wesleyks/master

fixes geraintluff/jsv4-php#10 and added the relevant unit test