Closed
Description
Error changed if you use not a string as second argument in preg_match function from E_WARNING before 8.0 to TypeError in 8+ versions.
Code example:
<?php $var = preg_match('#[0-9]#', ['test']); var_dump($var);
Result 7.4:
Warning: preg_match() expects parameter 2 to be string, array given in /home/user/scripts/code.php on line 3
bool(false)
Result 8.0:
Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /home/user/scripts/code.php:3
PS preg_match_all the same behavior
Metadata
Metadata
Assignees
Labels
No labels