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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: girgias@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 14:01:29 2024 UTC