Hi Benjamin,

Benjamin Coutu wrote:
   if (ZSTR_H(s1) && ZSTR_H(s1) != ZSTR_H(s2)) {
     return 0;
   }

Should that not be like this?:

    if (ZSTR_H(s1) && ZSTR_H(s2) && ZSTR_H(s1) != ZSTR_H(s2)) {

It would be possible the other string also has no hash value.

Otherwise this sounds sensible to me, but it is also so obvious that I was assuming until now that PHP does it, so maybe someone else knows a reason why we don't? (Maybe it's just not worth the extra branches?)

Thanks,
Andrea

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to