Since this happened to me on PHP 8.4.4, the reason for me is that the PHP interpreter is trying to find the yaml_*
function in the current namespace, so I called it with a backslash in front of the function.
\yaml_emit($payload);
Given the context, I assume that you are in the `RS\composer' namespace.