Additionally, change the type of XMLStream::getId() to string as ids in XMPP can take all shapes and sizes. To override the compatible behaviour and pass a simple procedure as a callable either use an anonymous function or pass "false" as $obj.