try {
$str = 'Hello World';
$result = lcfirst($str);
echo $result;
} catch (Error $e) {
echo 'Error: ' . $e->getMessage();
}
function customError($errno, $errstr) {
echo "Error: [$errno] $errstr";
}
set_error_handler("customError");
$str = 'Hello World';
$result = lcfirst($str);
echo $result;
$str = 'Hello World';
$result = @lcfirst($str);
if ($result === false) {
echo 'Error: lcfirst function failed';
} else {
echo $result;
}