Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Finfo Moved Away From Resource

Finfo functions have moved from resource to objects. In PHP 8.1, instead of returning a resource, it now returns a finfo object. Checks based on is_resource() must be upgraded, and are now dead code.

PHP code

<?php

var_dump(finfo_open());

?>

Before

resource(4) of type (file_info)

After

object(finfo)#1 (0) {
}

PHP version change

This behavior changed in 8.1.

See Also

Extension

© 2023-2026, Damien Seguy - Exakat