valitron icon indicating copy to clipboard operation
valitron copied to clipboard

PHP 8.1 Support

Open galdp opened this issue 2 years ago • 1 comments

In php 8.1 php functions will crash passing null instead of an string.

For example:

$rules = [
                'required' => [
                    'source',
                ],
                'url' => [
                    'source',
                ],
            ];

strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /vendor/vlucas/valitron/src/Valitron/Validator.php line 655

Acceted

  • strpos
  • *trim
  • I guess all other that require typed string value

Workaround

error_reporting(E_ALL & ~E_DEPRECATED);

galdp avatar May 05 '22 14:05 galdp

@galdp I'll fix this

Tautve avatar Oct 01 '22 06:10 Tautve