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

linkinfo() Rejects An Empty Path

linkinfo() used to accept an empty string as its path argument, emit a warning and return -1. In PHP 8.6, an empty path throws a ValueError.

PHP code

<?php

var_dump(linkinfo(''));

?>

Before

PHP Warning:  linkinfo(): No such file or directory

Warning: linkinfo(): No such file or directory
int(-1)

After

linkinfo(): Argument #1 ($path) must not be empty

PHP version change

This behavior changed in 8.6.

See Also

Error Messages

Extension

© 2023-2026, Damien Seguy - Exakat