This is a difference between PHP 5.3 (and probably also in earlier versions) and PHP 5.4.
Actually, you can see the problem in the source code of PHP if you are curious.
It is the file ext/mbstring/mbstring.c
which has the following difference in the PHP_FUNCTION(mb_substr)
function.
In PHP 5.3 they check for this condition:
if (argc < 3) {
len = str_len;
}
Whereas in PHP 5.4 they use:
if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) {
len = str_len;
}
You can find these definitions in the implementation of the mb_string
function which is started by PHP_FUNCTION(mb_substr)
in the mentioned file. Source code can be downloaded from php.net download page.