Skip to content

Value parameter for InvalidArgumentException #370

Open

Description

@rela589n

Hi there!

I am thinking about introducing a $value parameter for InvalidArgumentException so that it can be used for further analysis.

-    protected static function reportInvalidArgument(string $message): never
+    protected static function reportInvalidArgument(mixed $value, string $message): never
     {
-        throw new InvalidArgumentException($message);
+        throw new InvalidArgumentException($value, $message);
     }

What do you think about it?

Activity

  1. changed the title [-]Add a value to `InvalidArgumentException`[/-] [+]Value parameter for `InvalidArgumentException`[/+] on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions