Are there any performance differences between using substr() and $string{0} to extract the first character of a variable in PHP?

When extracting the first character of a string variable in PHP, using substr() and $string{0} both achieve the same result. However, there may be a slight performance difference between the two methods. Using $string{0} is slightly faster than substr() as it directly accesses the first character of the string. In contrast, substr() is a function call that involves additional overhead.

// Using substr() to extract the first character of a string
$firstChar = substr($string, 0, 1);

// Using $string{0} to extract the first character of a string
$firstChar = $string{0};