Skip to content

Value Error

ValueError occurs when a valid type but invalid value is passed.

try {
strpos("Hello", "");
} catch (ValueError $e) {
echo $e->getMessage();
}