kvz/phpjs — pull request #42 by jbboehr (2012-11-01 04:32:15+00:00)
Title: Fixed infinite loop in substr_count

If both needle and haystack are empty strings, enters an infinite loop.
PHP handles this as so:
php -r "var_dump(substr_count('', ''));"
PHP Warning: substr_count(): Empty substring in Command line code on line 1
bool(false)