Authentication fails when using stream wrapper without workgroup delimiter:
$contents = file_get_contents('smb://user:pass@server/path/to/file');
However the following succeeds (note extra workgroup delimiter after protocol):
$contents = file_get_contents('smb://;user:pass@server/path/to/file');
PHP 8.4.1
smbclient extension 1.1.2
libsmbclient library 4.20.2
Thanks Eduardo!