Skip to content

Commit

Permalink
return false'
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 5, 2023
1 parent 90635f9 commit dfb59bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,14 @@ public static function camel($value)
*
* @param string $subject
* @param int $index
* @return string|null
* @return string|false
*/
public static function charAt($subject, $index)
{
$length = mb_strlen($subject);

if ($index < 0 ? $index < -$length : $index > $length - 1) {
return null;
return false;
}

return mb_substr($subject, $index, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Stringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function basename($suffix = '')
* Get the character at the specified index.
*
* @param int $index
* @return string|null
* @return string|false
*/
public function charAt($index)
{
Expand Down

0 comments on commit dfb59bc

Please sign in to comment.