If you follow the link in the post you'll find a pretty convincing explanation why it's not possible to prevent leaking the length in the general case. I'm not certain that this applies to PHP code as well, since the problem is pretty low level.
However, leaking the length is much less of a problem than allowing the attacker to guess characters one by one.
However, leaking the length is much less of a problem than allowing the attacker to guess characters one by one.