How do I inspect hook variables?

Hey everyone!
I’m currently working on a user permission system for a magazine, which has three relevant user roles: author, editor and lead editor.
I would like to limit the user permissions of the editors, that they can only create authors and not editors or lead editors. Something like this:

'hooks' => [
   'user.create:before' => function ($input) {
      if ($this->user()->role() == 'editor') {
        if ($input->role() !== 'author') {
         throw new Exception('Sorry! Du kannst nur Autor*innen erstellen.');

So I tried it with the user.create:before hook, but whenever I want to use or inspect the $input variable inside of the hook with dump(), var_dump() or print_r() I get the following error message:

e.g.: dump($input)

Is there something obvious I’m not aware of or do I have to do it in a different way?

Kirby Version: 3.3.5
PHP: 7.4.1

Thanks in advance!

You can view dump details from console network tab.

Thanks for your replay!

I only get the error messages:
500 (Internal Server Error)
Error: The JSON response from the API could not be parsed. Please check your API connection.

Not the usual dump message :slightly_frowning_face:

Found the object, hidden in the 500 error, in the network tab, thank you!