php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81462 mime_content_type() indicates wrong arg num on TypeError
Submitted: 2021-09-20 21:46 UTC Modified: -
From: girgias@php.net Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 8.0.11RC1 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 46 = ?
Subscribe to this entry?

 
 [2021-09-20 21:46 UTC] girgias@php.net
Description:
------------
mime_content_type() indicates the wrong argument number when a TypeError is emitted.

Test script:
---------------
try {
    mime_content_type(1);
} catch (\TypeError $e) {
    echo $e->getMessage() . \PHP_EOL;
}

Expected result:
----------------
mime_content_type(): Argument #1 ($filename) must be of type resource|string, int given

Actual result:
--------------
mime_content_type(): Argument #2 must be of type resource|string, int given

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-20 21:49 UTC] git@php.net
Automatic comment on behalf of Girgias
Revision: https://github.com/php/php-src/commit/0ea38b950939f362898c4114672566ec7c561b2f
Log: Fix Bug #81462 mime_content_type() indicates wrong arg num on TypeError
 [2021-09-20 21:49 UTC] git@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Jan 31 22:05:53 2023 UTC