Prior to PHP 8, specifying length with zero-length strings or non-string values as input can produce potentially unexpected results.
<?php
foreach (['normal', '', true, false, NULL] as $value) {
echo gettype(substr($value, 0, 10)) . ' ' . substr($value, 0, 10);
}
/*
string normal
boolean
string 1
boolean
boolean
*/
?>