Skip to content

PHP 8.4: Incorrect MIME content type #17039

Description

@natanfelles

Description

The following code:

<?php

class Foo
{
    public function bar()
    {
        $this->baz(function () {});
    }
}

echo mime_content_type(__FILE__);

Resulted in this output in PHP 8.4:

application/javascript

But I expected this output, as in PHP <= 8.3:

text/x-php

Note that when you remove the function () {} snippet, it detects it as text/x-php.

Thank you!

PHP Version

PHP 8.4.1

Operating System

Ubuntu 24.04

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions