|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-01-20 08:29 UTC] nicolasgrekas@php.net
[2021-01-20 10:40 UTC] cmb@php.net
[2021-01-20 10:41 UTC] cmb@php.net
-Type: Bug
+Type: Documentation Problem
[2021-01-20 10:44 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
[2021-01-20 10:50 UTC] graham at alt-three dot com
-Status: Open
+Status: Closed
[2021-01-20 10:50 UTC] graham at alt-three dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
Description: ------------ Many mb_ functions are not throwing type errors when the provided input does not match the type signature, on PHP 8. Test script: --------------- <?php function f(string $x) {} var_dump((new ReflectionFunction('mb_strpos'))->getParameters()[0]->getType()->getName()); var_dump((new ReflectionFunction('f'))->getParameters()[0]->getType()->getName()); mb_strpos(null, 'a'); f(null); Expected result: ---------------- string(6) "string" string(6) "string" Fatal error: Uncaught TypeError: mb_strpos(): Argument #1 ($haystack) must be of type string Actual result: -------------- string(6) "string" string(6) "string" Fatal error: Uncaught TypeError: f(): Argument #1 ($x) must be of type string