php8.5
Home/ Manual/ language / predefined/ ValueError

ValueError

A ValueError is thrown when the type of an argument is correct but its value is incorrect. For example, passing a negative integer when the function expects a positive one, or passing an empty string/array when the function expects it to not be empty.

Intro

A ValueError is thrown when the type of an argument is correct but its value is incorrect. For example, passing a negative integer when the function expects a positive one, or passing an empty string/array when the function expects it to not be empty.

Class synopsis

extends Error { }

Source: language/predefined/valueerror.xml · from the official PHP manual (php/doc-en)