I have a breakpoint function I use for debugging in all my php development projects and which I want to use with Magento 2. It's a simple function and the details of it are irrelevant - it basically receives a variable as input and outputs the content of the variable in a nicely formatted way.
I'd like to include this as a 'global' function that I can call from any php or phtml file.
All the solutions I've found so far are either old (or at least pre magento 2) and don't seem to work, or they involve several files in several directories, registering modules etc. etc...
I'm not looking for other debugging methods, I'm sure M2 has loads of wonderfully complex and arcane ways to do this simple thing. The question is just about including a global function.